Provides constants for understanding numeric codepages, along with utilities to translate these into Java Character Sets.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CP_037
Codepage 037, a special case |
| public static final int | CP_EUC_JP
Codepage for EUC-JP |
| public static final int | CP_EUC_KR
Codepage for EUC-KR |
| public static final int | CP_GB18030
Codepage for GB18030 |
| public static final int | CP_GB2312
Codepage for GB2312 |
| public static final int | CP_GBK
Codepage for GBK, aka MS936 |
| public static final int | CP_ISO_2022_JP1
Codepage for ISO-2022-JP |
| public static final int | CP_ISO_2022_JP2
Another codepage for ISO-2022-JP |
| public static final int | CP_ISO_2022_JP3
Yet another codepage for ISO-2022-JP |
| public static final int | CP_ISO_2022_KR
Codepage for ISO-2022-KR |
| public static final int | CP_ISO_8859_1
Codepage for ISO-8859-1 |
| public static final int | CP_ISO_8859_2
Codepage for ISO-8859-2 |
| public static final int | CP_ISO_8859_3
Codepage for ISO-8859-3 |
| public static final int | CP_ISO_8859_4
Codepage for ISO-8859-4 |
| public static final int | CP_ISO_8859_5
Codepage for ISO-8859-5 |
| public static final int | CP_ISO_8859_6
Codepage for ISO-8859-6 |
| public static final int | CP_ISO_8859_7
Codepage for ISO-8859-7 |
| public static final int | CP_ISO_8859_8
Codepage for ISO-8859-8 |
| public static final int | CP_ISO_8859_9
Codepage for ISO-8859-9 |
| public static final int | CP_JOHAB
Codepage for Johab |
| public static final int | CP_KOI8_R
Codepage for KOI8-R |
| public static final int | CP_MAC_ARABIC
Codepage for Macintosh Arabic (Java: MacArabic) |
| public static final int | CP_MAC_CENTRAL_EUROPE
Codepage for Macintosh Central Europe (Latin-2) (Java: MacCentralEurope) |
| public static final int | CP_MAC_CHINESE_SIMPLE
Codepage for Macintosh Chinese Simplified (Java: unknown - use EUC_CN, ISO2022_CN_GB, MS936 or cp935) |
| public static final int | CP_MAC_CHINESE_TRADITIONAL
Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5, MS950, or cp937) |
| public static final int | CP_MAC_CROATIAN
Codepage for Macintosh Croatian (Java: MacCroatian) |
| public static final int | CP_MAC_CYRILLIC
Codepage for Macintosh Cyrillic (Java: MacCyrillic) |
| public static final int | CP_MAC_GREEK
Codepage for Macintosh Greek (Java: MacGreek) |
| public static final int | CP_MAC_HEBREW
Codepage for Macintosh Hebrew (Java: MacHebrew) |
| public static final int | CP_MAC_ICELAND
Codepage for Macintosh Iceland (Java: MacIceland) |
| public static final int | CP_MAC_JAPAN
Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or cp943) |
| public static final int | CP_MAC_KOREAN
Codepage for Macintosh Korean (Java: unknown - use EUC_KR or cp949) |
| public static final int | CP_MAC_ROMAN
Codepage for Macintosh Roman (Java: MacRoman) |
| public static final int | |
| public static final int | CP_MAC_ROMANIA
Codepage for Macintosh Romanian (Java: MacRomania) |
| public static final int | CP_MAC_THAI
Codepage for Macintosh Thai (Java: MacThai) |
| public static final int | CP_MAC_TURKISH
Codepage for Macintosh Turkish (Java: MacTurkish) |
| public static final int | CP_MAC_UKRAINE
Codepage for Macintosh Ukrainian (Java: MacUkraine) |
| public static final int | CP_MS949
Codepage for MS949 |
| public static final int | CP_SJIS
Codepage for SJIS |
| public static final int | CP_UNICODE
Codepage for Unicode |
| public static final int | CP_US_ACSII
Codepage for US-ASCII |
| public static final int | CP_US_ASCII2
Another codepage for US-ASCII |
| public static final int | CP_UTF16
Codepage for UTF-16 |
| public static final int | CP_UTF16_BE
Codepage for UTF-16 big-endian |
| public static final int | CP_UTF8
Codepage for UTF-8 |
| public static final int | CP_WINDOWS_1250
Codepage for Windows 1250 |
| public static final int | CP_WINDOWS_1251
Codepage for Windows 1251 |
| public static final int | CP_WINDOWS_1252
Codepage for Windows 1252 |
| public static final int | |
| public static final int | CP_WINDOWS_1253
Codepage for Windows 1253 |
| public static final int | CP_WINDOWS_1254
Codepage for Windows 1254 |
| public static final int | CP_WINDOWS_1255
Codepage for Windows 1255 |
| public static final int | CP_WINDOWS_1256
Codepage for Windows 1256 |
| public static final int | CP_WINDOWS_1257
Codepage for Windows 1257 |
| public static final int | CP_WINDOWS_1258
Codepage for Windows 1258 |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: The character encoding's name. If the codepage number is 65001, the encoding name is "UTF-8". All other positive numbers are mapped to their Java NIO names, normally either "windows-" followed by the number, eg "windows-1251", or "cp" followed by the number, e.g. if the codepage number is 1252 the returned character encoding name will be "cp1252".The codepage number codepage)Turns a codepage number into the equivalent character encoding's name (in Java NIO canonical naming format). |
| public static String | Returns: The character encoding's name, in either Java Lang format (eg Cp1251, ISO8859_5) or Java NIO format (eg windows-1252, ISO-8859-9)The codepage number codepage, boolean Should Java Lang or Java NIO naming be used? javaLangFormat)Turns a codepage number into the equivalent character encoding's name, in either Java NIO or Java Lang canonical naming. |
| public static byte[] | getBytesInCodePage(final String
The string to convert string, final int The codepage number codepage)Converts a string into bytes, in the equivalent character encoding to the supplied codepage number. |
| public static String | getStringFromCodePage(final byte[]
The byte of the string to convert string, final int The codepage number codepage)Converts the bytes into a String, based on the equivalent character encoding to the supplied codepage number. |
| public static String | getStringFromCodePage(final byte[]
The byte of the string to convert string, final int offset, final int length, final int The codepage number codepage)Converts the bytes into a String, based on the equivalent character encoding to the supplied codepage number. |
| CP_037 | back to summary |
|---|---|
| public static final int CP_037 Codepage 037, a special case | |
| CP_EUC_JP | back to summary |
|---|---|
| public static final int CP_EUC_JP Codepage for EUC-JP | |
| CP_EUC_KR | back to summary |
|---|---|
| public static final int CP_EUC_KR Codepage for EUC-KR | |
| CP_GB18030 | back to summary |
|---|---|
| public static final int CP_GB18030 Codepage for GB18030 | |
| CP_GB2312 | back to summary |
|---|---|
| public static final int CP_GB2312 Codepage for GB2312 | |
| CP_GBK | back to summary |
|---|---|
| public static final int CP_GBK Codepage for GBK, aka MS936 | |
| CP_ISO_2022_JP1 | back to summary |
|---|---|
| public static final int CP_ISO_2022_JP1 Codepage for ISO-2022-JP | |
| CP_ISO_2022_JP2 | back to summary |
|---|---|
| public static final int CP_ISO_2022_JP2 Another codepage for ISO-2022-JP | |
| CP_ISO_2022_JP3 | back to summary |
|---|---|
| public static final int CP_ISO_2022_JP3 Yet another codepage for ISO-2022-JP | |
| CP_ISO_2022_KR | back to summary |
|---|---|
| public static final int CP_ISO_2022_KR Codepage for ISO-2022-KR | |
| CP_ISO_8859_1 | back to summary |
|---|---|
| public static final int CP_ISO_8859_1 Codepage for ISO-8859-1 | |
| CP_ISO_8859_2 | back to summary |
|---|---|
| public static final int CP_ISO_8859_2 Codepage for ISO-8859-2 | |
| CP_ISO_8859_3 | back to summary |
|---|---|
| public static final int CP_ISO_8859_3 Codepage for ISO-8859-3 | |
| CP_ISO_8859_4 | back to summary |
|---|---|
| public static final int CP_ISO_8859_4 Codepage for ISO-8859-4 | |
| CP_ISO_8859_5 | back to summary |
|---|---|
| public static final int CP_ISO_8859_5 Codepage for ISO-8859-5 | |
| CP_ISO_8859_6 | back to summary |
|---|---|
| public static final int CP_ISO_8859_6 Codepage for ISO-8859-6 | |
| CP_ISO_8859_7 | back to summary |
|---|---|
| public static final int CP_ISO_8859_7 Codepage for ISO-8859-7 | |
| CP_ISO_8859_8 | back to summary |
|---|---|
| public static final int CP_ISO_8859_8 Codepage for ISO-8859-8 | |
| CP_ISO_8859_9 | back to summary |
|---|---|
| public static final int CP_ISO_8859_9 Codepage for ISO-8859-9 | |
| CP_JOHAB | back to summary |
|---|---|
| public static final int CP_JOHAB Codepage for Johab | |
| CP_KOI8_R | back to summary |
|---|---|
| public static final int CP_KOI8_R Codepage for KOI8-R | |
| CP_MAC_ARABIC | back to summary |
|---|---|
| public static final int CP_MAC_ARABIC Codepage for Macintosh Arabic (Java: MacArabic) | |
| CP_MAC_CENTRAL_EUROPE | back to summary |
|---|---|
| public static final int CP_MAC_CENTRAL_EUROPE Codepage for Macintosh Central Europe (Latin-2) (Java: MacCentralEurope) | |
| CP_MAC_CHINESE_SIMPLE | back to summary |
|---|---|
| public static final int CP_MAC_CHINESE_SIMPLE Codepage for Macintosh Chinese Simplified (Java: unknown - use EUC_CN, ISO2022_CN_GB, MS936 or cp935) | |
| CP_MAC_CHINESE_TRADITIONAL | back to summary |
|---|---|
| public static final int CP_MAC_CHINESE_TRADITIONAL Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5, MS950, or cp937) | |
| CP_MAC_CROATIAN | back to summary |
|---|---|
| public static final int CP_MAC_CROATIAN Codepage for Macintosh Croatian (Java: MacCroatian) | |
| CP_MAC_CYRILLIC | back to summary |
|---|---|
| public static final int CP_MAC_CYRILLIC Codepage for Macintosh Cyrillic (Java: MacCyrillic) | |
| CP_MAC_GREEK | back to summary |
|---|---|
| public static final int CP_MAC_GREEK Codepage for Macintosh Greek (Java: MacGreek) | |
| CP_MAC_HEBREW | back to summary |
|---|---|
| public static final int CP_MAC_HEBREW Codepage for Macintosh Hebrew (Java: MacHebrew) | |
| CP_MAC_ICELAND | back to summary |
|---|---|
| public static final int CP_MAC_ICELAND Codepage for Macintosh Iceland (Java: MacIceland) | |
| CP_MAC_JAPAN | back to summary |
|---|---|
| public static final int CP_MAC_JAPAN Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or cp943) | |
| CP_MAC_KOREAN | back to summary |
|---|---|
| public static final int CP_MAC_KOREAN Codepage for Macintosh Korean (Java: unknown - use EUC_KR or cp949) | |
| CP_MAC_ROMAN | back to summary |
|---|---|
| public static final int CP_MAC_ROMAN Codepage for Macintosh Roman (Java: MacRoman) | |
| CP_MAC_ROMAN_BIFF23 | back to summary |
|---|---|
| public static final int CP_MAC_ROMAN_BIFF23 | |
| CP_MAC_ROMANIA | back to summary |
|---|---|
| public static final int CP_MAC_ROMANIA Codepage for Macintosh Romanian (Java: MacRomania) | |
| CP_MAC_THAI | back to summary |
|---|---|
| public static final int CP_MAC_THAI Codepage for Macintosh Thai (Java: MacThai) | |
| CP_MAC_TURKISH | back to summary |
|---|---|
| public static final int CP_MAC_TURKISH Codepage for Macintosh Turkish (Java: MacTurkish) | |
| CP_MAC_UKRAINE | back to summary |
|---|---|
| public static final int CP_MAC_UKRAINE Codepage for Macintosh Ukrainian (Java: MacUkraine) | |
| CP_MS949 | back to summary |
|---|---|
| public static final int CP_MS949 Codepage for MS949 | |
| CP_SJIS | back to summary |
|---|---|
| public static final int CP_SJIS Codepage for SJIS | |
| CP_UNICODE | back to summary |
|---|---|
| public static final int CP_UNICODE Codepage for Unicode | |
| CP_US_ACSII | back to summary |
|---|---|
| public static final int CP_US_ACSII Codepage for US-ASCII | |
| CP_US_ASCII2 | back to summary |
|---|---|
| public static final int CP_US_ASCII2 Another codepage for US-ASCII | |
| CP_UTF16 | back to summary |
|---|---|
| public static final int CP_UTF16 Codepage for UTF-16 | |
| CP_UTF16_BE | back to summary |
|---|---|
| public static final int CP_UTF16_BE Codepage for UTF-16 big-endian | |
| CP_UTF8 | back to summary |
|---|---|
| public static final int CP_UTF8 Codepage for UTF-8 | |
| CP_WINDOWS_1250 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1250 Codepage for Windows 1250 | |
| CP_WINDOWS_1251 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1251 Codepage for Windows 1251 | |
| CP_WINDOWS_1252 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1252 Codepage for Windows 1252 | |
| CP_WINDOWS_1252_BIFF23 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1252_BIFF23 | |
| CP_WINDOWS_1253 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1253 Codepage for Windows 1253 | |
| CP_WINDOWS_1254 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1254 Codepage for Windows 1254 | |
| CP_WINDOWS_1255 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1255 Codepage for Windows 1255 | |
| CP_WINDOWS_1256 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1256 Codepage for Windows 1256 | |
| CP_WINDOWS_1257 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1257 Codepage for Windows 1257 | |
| CP_WINDOWS_1258 | back to summary |
|---|---|
| public static final int CP_WINDOWS_1258 Codepage for Windows 1258 | |
| CodePageUtil | back to summary |
|---|---|
| public CodePageUtil() | |
| codepageToEncoding | back to summary |
|---|---|
| public static String codepageToEncoding(final int codepage) throws UnsupportedEncodingException Turns a codepage number into the equivalent character encoding's name (in Java NIO canonical naming format).
| |
| codepageToEncoding | back to summary |
|---|---|
| public static String codepageToEncoding(final int codepage, boolean javaLangFormat) throws UnsupportedEncodingException Turns a codepage number into the equivalent character encoding's name, in either Java NIO or Java Lang canonical naming.
| |
| getBytesInCodePage | back to summary |
|---|---|
| public static byte[] getBytesInCodePage(final String string, final int codepage) throws UnsupportedEncodingException Converts a string into bytes, in the equivalent character encoding to the supplied codepage number.
| |
| getStringFromCodePage | back to summary |
|---|---|
| public static String getStringFromCodePage(final byte[] string, final int codepage) throws UnsupportedEncodingException Converts the bytes into a String, based on the equivalent character encoding to the supplied codepage number.
| |
| getStringFromCodePage | back to summary |
|---|---|
| public static String getStringFromCodePage(final byte[] string, final int offset, final int length, final int codepage) throws UnsupportedEncodingException Converts the bytes into a String, based on the equivalent character encoding to the supplied codepage number.
| |