Obtain the quality string in the indicated quality encoding, from the quality scores array

@param encoding - quality encoding
170277
private void obtainQualityStringFromQualityScoresArray(int encoding) {
        char[] qualityChars = new char[this.qualityScoresArray.length];
        // add the scale offset to each individual score and transform the result to a char
        for (int i = 0; i < this.qualityScoresArray.length; i++) {
            qualityChars[i] = (char) (this.qualityScoresArray[i] + FastQ.SCALE_OFFSET[encoding]);
        }
        this.quality = new String(qualityChars);
    }
618832
protected String decode(byte[] bytes, String encoding) {

        try {
            return new String(bytes, encoding);
        } catch (UnsupportedEncodingException e) {
            return new String(bytes);
        }
    }
783059
public static String getMimeName(String encoding)
  {
    if (encoding == null)
      return null;

    String value = _mimeName.get(encoding);
    if (value != null)
      return value;

    String upper = normalize(encoding);

    String lookup = _mimeName.get(upper);

    value = lookup == null ? upper : lookup;

    _mimeName.put(encoding, value);

    return value;
  }
217948
def GetEncoding(self):
        ''''''
        if self.encoding:
            vals = string.split(self.encoding, ',')
            if len(vals) > 2:
                try:
                    return charset_table[int(vals[2])]
                except KeyError:
                    pass
        return None
526365
@Override
    public String getCharacterEncoding() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getCharacterEncoding();
        } finally {
            collaborator.postInvoke();
        }
    }
1020231
function(data, encoding) {
      if (encoding == null) {
        encoding = 'hex';
      }
      if (Array.isArray(data)) {
        return data;
      }
      switch (encoding) {
        case 'base64':
          return Gibberish.base64.decode(data);
        case 'hex':
          return Gibberish.h2a(data);
        case 'utf8':
          return Gibberish.s2a(data);
        default:
          throw new Error("Encoding not supported");
      }
    }
305656
function(/**string*/ encoding) {
		if (/ISO-8859-([0-9]+)/i.test(encoding)) {
			IO.encoding = "ISO8859_"+RegExp.$1;
		}
		else {
			IO.encoding = encoding;
		}
	}
1090327
private void transformQualityScoresArray(int oldEncoding, int newEncoding) {
        // If the score types of the encodings are different
        if (FastQ.SCALE_SCORE[oldEncoding] != FastQ.SCALE_SCORE[newEncoding]) {
            // Score Map selection
            Map<Integer, Integer> scoreMap;
            if (FastQ.SCALE_SCORE[oldEncoding] == FastQ.PHRED_SCORE_TYPE) {
                scoreMap = FastQ.phredToSolexaMap;
            } else {
                scoreMap = FastQ.solexaToPhredMap;
            }
            // Transform each quality score in the quality scores array
            for (int i = 0; i < this.qualityScoresArray.length; i++) {
                if (qualityScoresArray[i] < 10) {
                    qualityScoresArray[i] = scoreMap.get(qualityScoresArray[i]);
                }
            }
        }
    }
76943
public void encodeTo(QualityFormat format, byte[] buffer, int offset) {
        byte vo = format.getOffset();
        for (int i = 0; i < data.length; ++i)
            buffer[offset++] = (byte) (data[i] + vo);
    }

    /**
     * Encodes current quality line with given offset. Common values for offset are 33 and 64.
     *
     * @param offset offset
     * @return bytes encoded quality values
     */
    public byte[] encode(int offset) {
        if (offset < 0 || offset > 70)
            throw new IllegalArgumentException();

        byte[] copy = new byte[data.length];
        for (int i = copy.length - 1; i >= 0; --i)
            copy[i] += data[i] + offset;
        return copy;
    }
89000
public String getStreamAsString(String encoding) throws IOException {
		String result = null;
		try {
			result = IOUtils.toString(getStream(), encoding);
		}
		catch (NullPointerException npex) {
			throw new IOException("Timeout has been forced by CommonHttpClient", npex);
		}
		return result;
	}
354358
public static String charset(final String encoding)
    {
        final String charsetName = STD_CHARSETS.get(encoding);
        if (charsetName != null)
        {
            return "java.nio.charset.StandardCharsets." + charsetName;
        }
        else
        {
            return "java.nio.charset.Charset.forName(\"" + encoding + "\")";
        }
    }
207048
public void setContentEncoding(String encoding) {
        if (encoding == null) {
            _properties.remove(AMQP_PROP_CONTENT_ENCODING);
            return;
        }
        
        _properties.put(AMQP_PROP_CONTENT_ENCODING, encoding);
    }
1346788
public static Map<Locale, QualityValue> getLocaleQualityValues(String header)
   {
      Map<String, QualityValue> stringResult = getStringQualityValues(header);
      if (stringResult == null)
         return null;
      Map<Locale, QualityValue> result = new LinkedHashMap<Locale, QualityValue>(stringResult.size() * 2);

      for (Entry<String, QualityValue> entry : stringResult.entrySet())
      {
         QualityValue quality = entry.getValue();
         Locale locale = null;
         String value = entry.getKey();
         if (value != null)
         {
            int length = value.length();
            if (length == 2)
            {
               locale = new Locale(value);
            }
            else if (length == 5 && value.charAt(2) == '-')
            {
               String language = value.substring(0, 2);
               String country = value.substring(3, 5);
               locale = new Locale(language, country);
            }
            else
            {
               logger.debug("Ignoring unsupported locale: " + value);
               continue;
            }
         }
         result.put(locale, quality);
      }

      if (logger.isDebugEnabled())
         logger.debug(result.toString());
      return result;
   }
694196
public String convertToEncoding(String subject, String encoding) 
        throws UnsupportedEncodingException {
        
        return new String(subject.getBytes(encoding), encoding);
    }
860501
private String getEncoding(final String contentType) {
        if (contentType == null || !contentType.contains(CHARSET)) {
            return DEFAULT_ENCODING;
        }
        String encoding = null;
        try {
            encoding = contentType.substring(contentType.indexOf(CHARSET) + CHARSET.length());
            encoding = encoding.toLowerCase().replaceAll("\"", "");
        } catch (Exception e) {
            //Extraction from the string failed.
        }
        if (!validEncodings.contains(encoding)) {
            LOGGER.warn("Invalid Encoding '{}' - using default - '{}'", encoding, DEFAULT_ENCODING);
            encoding = DEFAULT_ENCODING;
        }
        return encoding;
    }
1171147
public static String encode( String url, String encoding )
    {
        String encodedURL = null;
        try
        {
            encodedURL = URLCodec.encode( url, encoding );
        }
        catch ( java.io.UnsupportedEncodingException e )
        {
            // try utf-8 as a default encoding
            try
            {
                encodedURL = URLCodec.encode( url, DEFAULT_ENCODING );
            }
            catch ( java.io.UnsupportedEncodingException ignore )
            {
            }
        }
        return encodedURL;
    }
194493
@Override
    public String getJvmConverter(String encoding) {
        if (null != encoding) {
            String converter = this.converterMap.get(encoding.toLowerCase());
            if (null != converter) {
                return converter;
            }
        }
        return encoding;
    }