Oihana PHP Enums

CharacterSet uses ConstantsTrait

Enumeration of official character set codes as assigned by IANA and used in Internet standards and documentation.

This class defines integer constants representing the numeric identifiers of various character encodings (code pages) commonly used in databases, networking, and application protocols.

The constants correspond to values supported by connection options such as IANAAppCodePage, facilitating consistent charset handling in database drivers or other components interacting with textual data.

For the textual charset names (e.g. utf-8) used in a Content-Type header or by mb_* / iconv, see Charset.

See the official IANA character sets registry for full details: https://www.iana.org/assignments/character-sets/character-sets.xhtml

Example usage:

use oihana\enums\CharacterSet;

$charset = CharacterSet::UTF8;  // 106

Notes:

  • The UTF8 constant represents passing Unicode data without conversion when the database is configured for Unicode.
  • Some values are specific to certain vendors or drivers (e.g. Progress DataDirect), and may not appear in the official IANA list.
Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Constants

Big5  : int = 2026
EUC_JP  : int = 18
EUC_KR  : int = 38
GB2312  : int = 2025
GB_2312_80  : int = 57
GBK  : int = 113
HP_ROMAN8  : int = 2004
HZ_GB_2312  : int = 2085
IBM00858  : int = 2089
IBM01140  : int = 2091
IBM01141  : int = 2092
IBM01142  : int = 2093
IBM01143  : int = 2094
IBM01144  : int = 2095
IBM01145  : int = 2096
IBM01146  : int = 2097
IBM01147  : int = 2098
IBM01148  : int = 2099
IBM01149  : int = 2100
IBM037  : int = 2028
IBM038  : int = 2029
IBM1026  : int = 2063
IBM1047  : int = 2102
IBM273  : int = 2030
IBM277  : int = 2033
IBM278  : int = 2034
IBM280  : int = 2035
IBM284  : int = 2037
IBM285  : int = 2038
IBM290  : int = 2039
IBM297  : int = 2040
IBM420  : int = 2041
IBM424  : int = 2043
IBM437  : int = 2011
IBM500  : int = 2044
IBM775  : int = 2087
IBM850  : int = 2009
IBM851  : int = 2045
IBM852  : int = 2010
IBM855  : int = 2046
IBM857  : int = 2047
IBM860  : int = 2048
IBM861  : int = 2049
IBM862  : int = 2013
IBM863  : int = 2050
IBM864  : int = 2051
IBM865  : int = 2052
IBM866  : int = 2086
IBM868  : int = 2053
IBM869  : int = 2054
IBM870  : int = 2055
IBM871  : int = 2056
IBM918  : int = 2062
IBM_1025  : int = 2000001025
IBM_4396  : int = 2000004396
IBM_5026  : int = 2000005026
IBM_5035  : int = 2000005035
IBM_939  : int = 2000000939
IBM_943_P14A_2000  : int = 2000000943
IBM_Thai  : int = 2016
ISO_2022_CN  : int = 104
ISO_2022_CN_EXT  : int = 105
ISO_2022_JP  : int = 39
ISO_2022_JP_2  : int = 40
ISO_2022_KR  : int = 37
ISO_646_IRV  : int = 30
ISO_8859_1  : int = 4
ISO_8859_13  : int = 109
ISO_8859_14  : int = 110
ISO_8859_15  : int = 111
ISO_8859_2  : int = 5
ISO_8859_3  : int = 6
ISO_8859_4  : int = 7
ISO_8859_5  : int = 8
ISO_8859_6  : int = 9
ISO_8859_7  : int = 10
ISO_8859_8  : int = 11
ISO_8859_9  : int = 12
JIS_Encoding  : int = 16
KOI8_R  : int = 2084
KS_C_5601  : int = 36
MACINTOSH  : int = 2027
Shift_JIS  : int = 17
TIS_620  : int = 2259
US_ASCII  : int = 3
UTF8  : int = 106
Passes Unicode data without conversion if the database is set to Unicode.
WINDOWS_1250  : int = 2250
WINDOWS_1251  : int = 2251
WINDOWS_1252  : int = 2252
WINDOWS_1253  : int = 2253
WINDOWS_1254  : int = 2254
WINDOWS_1255  : int = 2255
WINDOWS_1256  : int = 2256
WINDOWS_1257  : int = 2257
WINDOWS_1258  : int = 2258
WINDOWS_31J  : int = 2024

Constants

IBM_943_P14A_2000

public int IBM_943_P14A_2000 = 2000000943

UTF8

Passes Unicode data without conversion if the database is set to Unicode.

public int UTF8 = 106
On this page

Search results