Access the string encoding utils service.
Make sure encoding service never returns null: even after this component has
been deactivated.

@return EncodingUtils
198250
public static EncodingUtils getEncodingUtils() {
        HttpDispatcher f = instance.get().get();
        EncodingUtils svc = null;
        if (f != null) {
            svc = f.encodingSvc;
        }

        if (svc == null)
            svc = new EncodingUtilsImpl();

        return svc;
    }
1284436
public function getCharsets()
    {
        if (null !== $this->charsets) {
            return $this->charsets;
        }

        return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
    }
668001
public function getEncoding()
    {
        $content = $this->getHeaderLine('content-type');
        if (!$content) {
            return null;
        }
        preg_match('/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i', $content, $matches);
        if (empty($matches[1])) {
            return null;
        }

        return $matches[1];
    }
73846
public Charset getCharSet() {
		String charSet = getParameter(PARAM_CHARSET);
		return (charSet != null ? Charset.forName(unquote(charSet)) : null);
	}
516722
public function getCharset()
    {
        if (isset($this->headers['content-type']) &&
            ($value = $this->getInlineValue($this->headers['content-type'], 'charset', ';')) !== false
        ) {
            return $value;
        }
        return self::ENCODING;
    }
1119181
public function getEncodings()
    {
        if (null !== $this->encodings) {
            return $this->encodings;
        }

        return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
    }
1034886
public static Encoding getEncodingFromString(String encodingString){
        if(encodingString == null || encodingString.isEmpty() || encodingString.equalsIgnoreCase("Plain")){
            return Encoding.Plain;
        } else if(encodingString.equalsIgnoreCase("gzip")){
            return Encoding.Gzip;
        } else {
            throw new IllegalArgumentException("Unsupported encoding");
        }
    }
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 + "\")";
        }
    }
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;
	}
966317
public String getEncoding() {
    if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_encoding == null)
      jcasType.jcas.throwFeatMissing("encoding", "de.julielab.jules.types.ace.SourceFile");
    return jcasType.ll_cas.ll_getStringValue(addr, ((SourceFile_Type)jcasType).casFeatCode_encoding);}
249993
public String getStringF() {
		int len = getInt();
		byte[] utf = new byte[len];
		System.arraycopy(buf, bufPosition, utf, 0, utf.length);
		bufPosition += utf.length;
		return new String(utf, 0, len, charsetUTF8);
	}
1195374
public function getSupportedCharsets()
    {
        if ($this->supportedCharsets === null) {
            $supportedCharsets = [];
            $rs = $this->executeQuery('SHOW CHARACTER SET');
            while (($row = $rs->fetch(PDO::FETCH_ASSOC)) !== false) {
                if (!isset($row['Charset']) || !isset($row['Default collation'])) {
                    throw new Exception(t('Unrecognized result of the "%s" database query.', 'SHOW CHARACTER SET'));
                }
                $supportedCharsets[strtolower($row['Charset'])] = strtolower($row['Default collation']);
            }
            $this->supportedCharsets = $supportedCharsets;
        }

        return $this->supportedCharsets;
    }
913411
public function getEncodingReservedUnit()
    {
        $units = $this->_getEntityList('EncodingReservedUnitTypes');
        if (isset($units) && count($units) > 0) {
            return EncodingReservedUnit::createFromOptions($units[0]);
        }

        return null;
    }
978887
public function encodings()
    {
        $encodings = [];
        $added = [];

        foreach ($this->candidates as $candidate) {
            foreach ($candidate->encodings() as $encoding) {
                if (isset($added[$encoding])) {
                    continue;
                }
                $encodings[] = $encoding;
                $added[$encoding] = true;
            }
        }

        return $encodings;
    }
817078
public String getString()
    {
        StringBuilder sb = new StringBuilder();
        for (int ii=0;ii<marked;ii++)
        {
            sb.append(charAt(ii));
        }
        return sb.toString();
    }
377005
public String toUrlEncodedString() {
        QueryStringEncoder encoder = new QueryStringEncoder("");
        for (Map.Entry<String, String> entry : formValues.entrySet()) {
            encoder.addParam(entry.getKey(), entry.getValue());
        }
        StringBuilder ues = new StringBuilder(encoder.toString());
        if (ues.length() > 0 && ues.charAt(0) == '?') {
            ues.deleteCharAt(0);
        }
        return ues.toString();
    }
399065
public function encode()
    {
        if (is_null($this->getParameter('value')))
            return '""';

        $value = $this->getParameter('value');
        $index = $this->getParameter('index');

        if($index != null && is_array($value))
            return JSONUtils::encode($value[$index]);

        return JSONUtils::encode($value);
    }