LIBRARY_ENCODING
LIBRARY_ENCODING
Implements the AbstractEncodingConverter using utf8_encode() and utf_decode().
This abstract class does not specify how the actual conversion of a single string is done. Create a subclass to implement the conversion method. Also note that none of these methods handle URL en- or decoding but only deal with plain character encodings.
__construct(string $loggerClass, \FACTFinder\Core\ConfigurationInterface $configuration)
| string | $loggerClass | Class name of logger to use. The class should implement FACTFinder\Util\LoggerInterface. |
| \FACTFinder\Core\ConfigurationInterface | $configuration | Configuration object to use. |
encodeContentForPage(mixed $data) : mixed
Converts data held by the library for use on the rendered page.
Hence, it converts from the library's encoding (UTF-8) to the configured page content encoding.
| mixed | $data | Could either be a string or an associative array. |
decodeClientUrlData(mixed $data) : mixed
Converts data obtained from the client URL for use within the library.
Hence, it converts from the configured client URL encoding to the library's encoding (UTF-8).
| mixed | $data | Data obtained from the client URL. Note that this data should already be URL decoded. Could either be a string or an associative array. |
encodeClientUrlData(mixed $data) : mixed
Converts data held by the library for use in a client URL.
Hence, it converts from the configured client URL encoding to the library's encoding (UTF-8).
| mixed | $data | Data to be used in the client URL. Note that this data should not yet be URL encoded. Could either be a string or an associative array. |
convert( $inCharset, $outCharset, mixed $data) : mixed
Converts data from $inCharset to $outCharset.
| $inCharset | ||
| $outCharset | ||
| mixed | $data | If a string is given, it's encoding will be converted. If an associative array is given, keys and values will be converted recursively. All other data types will be returned unchanged. |
convert_recursive( $inCharset, $outCharset, mixed $data) : mixed
Converts data from $inCharset to $outCharset.
| $inCharset | ||
| $outCharset | ||
| mixed | $data | If a string is given, it's encoding will be converted. If an associative array is given, keys and values will be converted recursively. All other data types will be returned unchanged. |