index.js
function getDecoder (encoding) {
  if (!encoding) return null

  try {
    return iconv.getDecoder(encoding)
  } catch (e) {
    // error getting decoder
    if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e

    // the encoding was not found
    throw createError(415, 'specified encoding unsupported', {
      encoding: encoding,
      type: 'encoding.unsupported'
    })
  }
}
function getDecoder (encoding) {
  if (!encoding) return null

  try {
    return iconv.getDecoder(encoding)
  } catch (e) {
    // error getting decoder
    if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e

    // the encoding was not found
    throw createError(415, 'specified encoding unsupported', {
      encoding: encoding,
      type: 'encoding.unsupported'
    })
  }
}
function getDecoder ( encoding ) { if ( ! encoding ) return null try { return iconv . getDecoder ( encoding ) } catch ( e ) { // error getting decoder if ( ! ICONV_ENCODING_MESSAGE_REGEXP . test ( e . message ) ) throw e // the encoding was not found throw createError ( 415 , 'specified encoding unsupported' , { encoding : encoding , type : 'encoding.unsupported' } ) } }
Get the decoder for a given encoding.

@param {string} encoding
@private
Get the decoder for a given encoding .