php-extended/php-charset-object

A library that implements the php-charset-interface package


README

A library that implements the php-charset-interface package.

This library implements that database from the iana.

coverage build status

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/php-charset-object ^7

Basic Usage

This library may be used the following way :

  • List all character sets

use PhpExtended\Charset\CharacterSet;

foreach(CharacterSet::values() as $characterSet)
{
	// do something here
}

  • Search for a specific character set (the values have to be the name or the full name of the character set)

use PhpExtended\Charset\CharacterSetReference;

/* @var $utf8 \PhpExtended\Charset\UTF_8 */
$utf8 = CharacterSetReference::lookup('UTF-8');

You may also search by less common values (The values have to be in the aliases of the character set or in the name or full name).


/* @var $latin1 \PhpExtended\Charset\ISO_8859_1 */
$latin1 = CharacterSetReference::lookupAlias('latin1');

Implemented Charsets Status

Character Set NameCharacter Set Class
ANSI_X3.110-1983ANSI_X3_110_1983
ASMO_449ASMO_449
Adobe-Standard-EncodingADOBE_STANDARD_ENCODING
Adobe-Symbol-EncodingADOBE_SYMBOL_ENCODING
Amiga-1251AMIGA_1251
BOCU-1BOCU_1
BRFBRF
BS_4730BS_4730
BS_viewdataBS_VIEWDATA
Big5BIG5
Big5-HKSCSBIG5_HKSCS
CESU-8CESU_8
CP50220CP50220
CP51932CP51932
CSA_Z243.4-1985-1CSA_Z243_4_1985_1
CSA_Z243.4-1985-2CSA_Z243_4_1985_2
CSA_Z243.4-1985-grCSA_Z243_4_1985_GR
CSN_369103CSN_369103
DEC-MCSDEC_MCS
DIN_66003DIN_66003
DS_2089DS_2089
EBCDIC-AT-DEEBCDIC_AT_DE
EBCDIC-AT-DE-AEBCDIC_AT_DE_A
EBCDIC-CA-FREBCDIC_CA_FR
EBCDIC-DK-NOEBCDIC_DK_NO
EBCDIC-DK-NO-AEBCDIC_DK_NO_A
EBCDIC-ESEBCDIC_ES
EBCDIC-ES-AEBCDIC_ES_A
EBCDIC-ES-SEBCDIC_ES_S
EBCDIC-FI-SEEBCDIC_FI_SE
EBCDIC-FI-SE-AEBCDIC_FI_SE_A
EBCDIC-FREBCDIC_FR
EBCDIC-ITEBCDIC_IT
EBCDIC-PTEBCDIC_PT
EBCDIC-UKEBCDIC_UK
EBCDIC-USEBCDIC_US
ECMA-cyrillicECMA_CYRILLIC
ESES
ES2ES2
EUC-JPEUC_JP
EUC-KREUC_KR
Extended_UNIX_Code_Fixed_Width_for_JapaneseEXTENDED_UNIX_CODE_FIXED_WIDTH_FOR_JAPANESE
GB18030GB18030
GB2312GB2312
GBKGBK
GB_1988-80GB_1988_80
GB_2312-80GB_2312_80
GOST_19768-74GOST_19768_74
HP-DeskTopHP_DESKTOP
HP-LegalHP_LEGAL
HP-Math8HP_MATH8
HP-Pi-fontHP_PI_FONT
HZ-GB-2312HZ_GB_2312
IBM-SymbolsIBM_SYMBOLS
IBM-ThaiIBM_THAI
IBM00858IBM00858
IBM00924IBM00924
IBM01140IBM01140
IBM01141IBM01141
IBM01142IBM01142
IBM01143IBM01143
IBM01144IBM01144
IBM01145IBM01145
IBM01146IBM01146
IBM01147IBM01147
IBM01148IBM01148
IBM01149IBM01149
IBM037IBM037
IBM038IBM038
IBM1026IBM1026
IBM1047IBM1047
IBM273IBM273
IBM274IBM274
IBM275IBM275
IBM277IBM277
IBM278IBM278
IBM280IBM280
IBM281IBM281
IBM284IBM284
IBM285IBM285
IBM290IBM290
IBM297IBM297
IBM420IBM420
IBM423IBM423
IBM424IBM424
IBM437IBM437
IBM500IBM500
IBM775IBM775
IBM850IBM850
IBM851IBM851
IBM852IBM852
IBM855IBM855
IBM857IBM857
IBM860IBM860
IBM861IBM861
IBM862IBM862
IBM863IBM863
IBM864IBM864
IBM865IBM865
IBM866IBM866
IBM868IBM868
IBM869IBM869
IBM870IBM870
IBM871IBM871
IBM880IBM880
IBM891IBM891
IBM903IBM903
IBM904IBM904
IBM905IBM905
IBM918IBM918
IEC_P27-1IEC_P27_1
INISINIS
INIS-8INIS_8
INIS-cyrillicINIS_CYRILLIC
INVARIANTINVARIANT
ISO-10646-J-1ISO_10646_J_1
ISO-10646-UCS-2ISO_10646_UCS_2
ISO-10646-UCS-4ISO_10646_UCS_4
ISO-10646-UCS-BasicISO_10646_UCS_BASIC
ISO-10646-UTF-1ISO_10646_UTF_1
ISO-10646-Unicode-Latin1ISO_10646_UNICODE_LATIN1
ISO-11548-1ISO_11548_1
ISO-2022-CNISO_2022_CN
ISO-2022-CN-EXTISO_2022_CN_EXT
ISO-2022-JPISO_2022_JP
ISO-2022-JP-2ISO_2022_JP_2
ISO-2022-KRISO_2022_KR
ISO-8859-1ISO_8859_1
ISO-8859-1-Windows-3.0-Latin-1ISO_8859_1_WINDOWS_3_0_LATIN_1
ISO-8859-1-Windows-3.1-Latin-1ISO_8859_1_WINDOWS_3_1_LATIN_1
ISO-8859-10ISO_8859_10
ISO-8859-13ISO_8859_13
ISO-8859-14ISO_8859_14
ISO-8859-15ISO_8859_15
ISO-8859-16ISO_8859_16
ISO-8859-2ISO_8859_2
ISO-8859-2-Windows-Latin-2ISO_8859_2_WINDOWS_LATIN_2
ISO-8859-3ISO_8859_3
ISO-8859-4ISO_8859_4
ISO-8859-5ISO_8859_5
ISO-8859-6ISO_8859_6
ISO-8859-6-EISO_8859_6_E
ISO-8859-6-IISO_8859_6_I
ISO-8859-7ISO_8859_7
ISO-8859-8ISO_8859_8
ISO-8859-8-EISO_8859_8_E
ISO-8859-8-IISO_8859_8_I
ISO-8859-9ISO_8859_9
ISO-8859-9-Windows-Latin-5ISO_8859_9_WINDOWS_LATIN_5
ISO-Unicode-IBM-1261ISO_UNICODE_IBM_1261
ISO-Unicode-IBM-1264ISO_UNICODE_IBM_1264
ISO-Unicode-IBM-1265ISO_UNICODE_IBM_1265
ISO-Unicode-IBM-1268ISO_UNICODE_IBM_1268
ISO-Unicode-IBM-1276ISO_UNICODE_IBM_1276
ISO_10367-boxISO_10367_BOX
ISO_2033-1983ISO_2033_1983
ISO_5427ISO_5427
ISO_5427:1981ISO_5427_1981
ISO_5428:1980ISO_5428_1980
ISO_646.basic:1983ISO_646_BASIC_1983
ISO_646.irv:1983ISO_646_IRV_1983
ISO_6937-2-25ISO_6937_2_25
ISO_6937-2-addISO_6937_2_ADD
ISO_8859-suppISO_8859_SUPP
ITIT
JIS_C6220-1969-jpJIS_C6220_1969_JP
JIS_C6220-1969-roJIS_C6220_1969_RO
JIS_C6226-1978JIS_C6226_1978
JIS_C6226-1983JIS_C6226_1983
JIS_C6229-1984-aJIS_C6229_1984_A
JIS_C6229-1984-bJIS_C6229_1984_B
JIS_C6229-1984-b-addJIS_C6229_1984_B_ADD
JIS_C6229-1984-handJIS_C6229_1984_HAND
JIS_C6229-1984-hand-addJIS_C6229_1984_HAND_ADD
JIS_C6229-1984-kanaJIS_C6229_1984_KANA
JIS_EncodingJIS_ENCODING
JIS_X0201JIS_X0201
JIS_X0212-1990JIS_X0212_1990
JUS_I.B1.002JUS_I_B1_002
JUS_I.B1.003-macJUS_I_B1_003_MAC
JUS_I.B1.003-serbJUS_I_B1_003_SERB
KOI7-switchedKOI7_SWITCHED
KOI8-RKOI8_R
KOI8-UKOI8_U
KSC5636KSC5636
KS_C_5601-1987KS_C_5601_1987
KZ-1048KZ_1048
Latin-greek-1LATIN_GREEK_1
MNEMMNEM
MNEMONICMNEMONIC
MSZ_7795.3MSZ_7795_3
Microsoft-PublishingMICROSOFT_PUBLISHING
NATS-DANONATS_DANO
NATS-DANO-ADDNATS_DANO_ADD
NATS-SEFINATS_SEFI
NATS-SEFI-ADDNATS_SEFI_ADD
NC_NC00-10:81NC_NC00_10_81
NF_Z_62-010NF_Z_62_010
NF_Z62-010(1973)NF_Z_62_010__1973_
NS_4551-1NS_4551_1
NS_4551-2NS_4551_2
OSD_EBCDIC_DF03_IRVOSD_EBCDIC_DF03_IRV
OSD_EBCDIC_DF04_1OSD_EBCDIC_DF04_1
OSD_EBCDIC_DF04_15OSD_EBCDIC_DF04_15
PC8-Danish-NorwegianPC8_DANISH_NORWEGIAN
PC8-TurkishPC8_TURKISH
PTPT
PT2PT2
PTCP154PTCP154
SCSUSCSU
SEN_850200_BSEN_850200_B
SEN_850200_CSEN_850200_C
Shift_JISSHIFT_JIS
T.101-G2T_101_G2
T.61-7bitT_61_7BIT
T.61-8bitT_61_8BIT
TIS-620TIS_620
TSCIITSCII
UNICODE-1-1UNICODE_1_1
UNICODE-1-1-UTF-7UNICODE_1_1_UTF_7
UNKNOWN-8BITUNKNOWN_8BIT
US-ASCIIUS_ASCII
UTF-16UTF_16
UTF-16BEUTF_16BE
UTF-16LEUTF_16LE
UTF-32UTF_32
UTF-32BEUTF_32BE
UTF-32LEUTF_32LE
UTF-7UTF_7
UTF-8UTF_8
VIQRVIQR
VISCIIVISCII
Ventura-InternationalVENTURA_INTERNATIONAL
Ventura-MathVENTURA_MATH
Ventura-USVENTURA_US
Windows-31JWINDOWS_31J
dk-usDK_US
greek-ccittGREEK_CCITT
greek7GREEK7
greek7-oldGREEK7_OLD
hp-roman8HP_ROMAN8
iso-ir-90ISO_IR_90
latin-greekLATIN_GREEK
latin-lapLATIN_LAP
macintoshMACINTOSH
us-dkUS_DK
videotex-supplVIDEOTEX_SUPPL
windows-1250WINDOWS_1250
windows-1251WINDOWS_1251
windows-1252WINDOWS_1252
windows-1253WINDOWS_1253
windows-1254WINDOWS_1254
windows-1255WINDOWS_1255
windows-1256WINDOWS_1256
windows-1257WINDOWS_1257
windows-1258WINDOWS_1258
windows-874WINDOWS_874

License

MIT (See license file).