Encoding
class Encoding (View source)
Encoding conversion helper class
Constants
ENGINE_NONE |
None encoding conversion engine |
ENGINE_ICONV |
iconv encoding conversion engine |
ENGINE_MB |
mbstring encoding conversion engine |
Methods
Initializes encoding engine detecting available backends.
Setter for engine. Use with caution, mostly useful for testing.
Checks whether there is any charset conversion supported
Converts encoding of text according to parameters with detected conversion function.
Detects whether Kanji encoding is available
Setter for Kanji encodings. Use with caution, mostly useful for testing.
Setter for Kanji encodings. Use with caution, mostly useful for testing.
Reverses SJIS & EUC-JP position in the encoding codes list
Kanji string encoding convert
Kanji file encoding convert
Defines radio form fields to switch between encoding modes
Lists available encodings.
Details
static void
initEngine()
Initializes encoding engine detecting available backends.
static void
setEngine(int $engine)
Setter for engine. Use with caution, mostly useful for testing.
static bool
isSupported()
Checks whether there is any charset conversion supported
static string
convertString(string $srcCharset, string $destCharset, string $what)
Converts encoding of text according to parameters with detected conversion function.
static bool
canConvertKanji()
Detects whether Kanji encoding is available
static string
getKanjiEncodings()
Setter for Kanji encodings. Use with caution, mostly useful for testing.
static void
setKanjiEncodings(string $value)
Setter for Kanji encodings. Use with caution, mostly useful for testing.
static void
kanjiChangeOrder()
Reverses SJIS & EUC-JP position in the encoding codes list
static string
kanjiStrConv(string $str, string $enc, string $kana)
Kanji string encoding convert
static string
kanjiFileConv(string $file, string $enc, string $kana)
Kanji file encoding convert
static string
kanjiEncodingForm()
Defines radio form fields to switch between encoding modes
static array
listEncodings()
Lists available encodings.