Toon posts:

Encoding onder windows (again)

Pagina: 1
Acties:
  • 193 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Sorry voor de crosspost, maar in webscripting had ik geen antwoord, maar mijn vragen:

Is een "ASCII" bestand onder windows gecodeerd volgens Western European (Windows) of Western European (ISO).

En is die Western European (ISO) gelijk aan iso-8859-1 oftewel Latin-1?

En weet iemand ook een manier om tekst van iso-8859-1 om te zetten naar UTF-8?

  • mbravenboer
  • Registratie: Januari 2000
  • Laatst online: 06-11-2025
Hier een klein overzichtje van veel voorkomende charsets (schaamteloos gekopieerd uit de Java API Documentation)

US-ASCII - Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set

ISO-8859-1 - ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1

UTF-8 - Eight-bit UCS Transformation Format

UTF-16BE - Sixteen-bit UCS Transformation Format, big-endian byte order

UTF-16LE - Sixteen-bit UCS Transformation Format, little-endian byte order

UTF-16 - Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark

Hier vind je nog een lijstje van HEEEL VEEL charsets:
http://www.iana.org/assignments/character-sets

Volgens mij is de standaard encodering on MS Windows ISO-8859-1, maar dat weet ik niet zeker.

Omzetten van encodings kan heel makkelijk in Java. Ik weet niet of je daar kennis van hebt? In goede (en nieuwe) editors kan je ook vaak aangeven in welke encoding je op wilt slaan.

Blog, Stratego/XT: Program Transformation, SDF: Syntax Definition, Nix: Software Deployment


Verwijderd

Oef, we komen nu op het wazige gebied van de karakter-set-definities...
Ok, ik gooi hier ff neer wat ik zelf onlangs heb uitgezocht (lees: geprobeerd uit te zoeken); maar 't is misschien handiger als je post wat je eigenlijk wilt bereiken :?

Anyhow, volgens de java system properties is op m'n windhoos de default encoding:

file.encoding = Cp1252

De org.apache.xalan.serialize.Encodings vindt ISO8859-1 en Cp1252 hetzelfde (maar let op het commentaar wat de ontwikkelaar erachter heeft gezet :+ ):

// <preferred MIME name>, <Java encoding name>
// new EncodingInfo( "ISO 8859-1", "CP1252"); // Close enough, I guess

En hier is de rest van de aliassen uit die file:

new EncodingInfo("WINDOWS-1250", "Cp1250", 0x00FF), // Peter Smolik
// Patch attributed to havardw@underdusken.no (Håvard Wigtil)
new EncodingInfo("WINDOWS-1252", "Cp1252", 0x00FF),
new EncodingInfo("UTF-8", "UTF8", 0xFFFF),
new EncodingInfo("US-ASCII", "ISO8859_1", 0x7F),
new EncodingInfo("ISO-8859-1", "ISO8859_1", 0x00FF),
// Patch attributed to havardw@underdusken.no (Håvard Wigtil)
new EncodingInfo("ISO-8859-1", "ISO8859-1", 0x00FF),
new EncodingInfo("ISO-8859-2", "ISO8859_2", 0x00FF),
// I'm going to apply "ISO8859-X" variant to all these, to be safe.
new EncodingInfo("ISO-8859-2", "ISO8859-2", 0x00FF),
new EncodingInfo("ISO-8859-3", "ISO8859_3", 0x00FF),
new EncodingInfo("ISO-8859-3", "ISO8859-3", 0x00FF),
new EncodingInfo("ISO-8859-4", "ISO8859_4", 0x00FF),
new EncodingInfo("ISO-8859-4", "ISO8859-4", 0x00FF),
new EncodingInfo("ISO-8859-5", "ISO8859_5", 0x00FF),
new EncodingInfo("ISO-8859-5", "ISO8859-5", 0x00FF),
new EncodingInfo("ISO-8859-6", "ISO8859_6", 0x00FF),
new EncodingInfo("ISO-8859-6", "ISO8859-6", 0x00FF),
new EncodingInfo("ISO-8859-7", "ISO8859_7", 0x00FF),
new EncodingInfo("ISO-8859-7", "ISO8859-7", 0x00FF),
new EncodingInfo("ISO-8859-8", "ISO8859_8", 0x00FF),
new EncodingInfo("ISO-8859-8", "ISO8859-8", 0x00FF),
new EncodingInfo("ISO-8859-9", "ISO8859_9", 0x00FF),
new EncodingInfo("ISO-8859-9", "ISO8859-9", 0x00FF),
new EncodingInfo("US-ASCII", "8859_1", 0x00FF), // ?
new EncodingInfo("ISO-8859-1", "8859_1", 0x00FF),
new EncodingInfo("ISO-8859-2", "8859_2", 0x00FF),
new EncodingInfo("ISO-8859-3", "8859_3", 0x00FF),
new EncodingInfo("ISO-8859-4", "8859_4", 0x00FF),
new EncodingInfo("ISO-8859-5", "8859_5", 0x00FF),
new EncodingInfo("ISO-8859-6", "8859_6", 0x00FF),
new EncodingInfo("ISO-8859-7", "8859_7", 0x00FF),
new EncodingInfo("ISO-8859-8", "8859_8", 0x00FF),
new EncodingInfo("ISO-8859-9", "8859_9", 0x00FF),
new EncodingInfo("ISO-8859-1", "8859-1", 0x00FF),
new EncodingInfo("ISO-8859-2", "8859-2", 0x00FF),
new EncodingInfo("ISO-8859-3", "8859-3", 0x00FF),
new EncodingInfo("ISO-8859-4", "8859-4", 0x00FF),
new EncodingInfo("ISO-8859-5", "8859-5", 0x00FF),
new EncodingInfo("ISO-8859-6", "8859-6", 0x00FF),
new EncodingInfo("ISO-8859-7", "8859-7", 0x00FF),
new EncodingInfo("ISO-8859-8", "8859-8", 0x00FF),
new EncodingInfo("ISO-8859-9", "8859-9", 0x00FF),
new EncodingInfo("ISO-2022-JP", "JIS", 0xFFFF),
new EncodingInfo("SHIFT_JIS", "SJIS", 0xFFFF),
new EncodingInfo("EUC-JP", "EUC_JP", 0xFFFF),
new EncodingInfo("EUC-KR", "EUC_KR", 0xFFFF),
new EncodingInfo("EUC-CN", "EUC_CN", 0xFFFF),
new EncodingInfo("EUC-TW", "EUC_TW", 0xFFFF),
new EncodingInfo("GB2312", "EUC_CN", 0xFFFF),
new EncodingInfo("EUC-JP", "EUC-JP", 0xFFFF),
new EncodingInfo("EUC-KR", "EUC-KR", 0xFFFF),
new EncodingInfo("EUC-CN", "EUC-CN", 0xFFFF),
new EncodingInfo("EUC-TW", "EUC-TW", 0xFFFF),
new EncodingInfo("GB2312", "EUC-CN", 0xFFFF),
new EncodingInfo("GB2312", "GB2312", 0xFFFF),
new EncodingInfo("BIG5", "Big5", 0xFFFF),
new EncodingInfo("EUC-JP", "EUCJIS", 0xFFFF),
new EncodingInfo("EUC-KR", "KSC5601", 0xFFFF),
new EncodingInfo("ISO-2022-KR", "ISO2022KR", 0xFFFF),
new EncodingInfo("KOI8-R", "KOI8_R", 0xFFFF),
new EncodingInfo("EBCDIC-CP-US", "Cp037", 0x00FF),
new EncodingInfo("EBCDIC-CP-CA", "Cp037", 0x00FF),
new EncodingInfo("EBCDIC-CP-NL", "Cp037", 0x00FF),
new EncodingInfo("EBCDIC-CP-DK", "Cp277", 0x00FF),
new EncodingInfo("EBCDIC-CP-NO", "Cp277", 0x00FF),
new EncodingInfo("EBCDIC-CP-FI", "Cp278", 0x00FF),
new EncodingInfo("EBCDIC-CP-SE", "Cp278", 0x00FF),
new EncodingInfo("EBCDIC-CP-IT", "Cp280", 0x00FF),
new EncodingInfo("EBCDIC-CP-ES", "Cp284", 0x00FF),
new EncodingInfo("EBCDIC-CP-GB", "Cp285", 0x00FF),
new EncodingInfo("EBCDIC-CP-FR", "Cp297", 0x00FF),
new EncodingInfo("EBCDIC-CP-AR1", "Cp420", 0x00FF),
new EncodingInfo("EBCDIC-CP-HE", "Cp424", 0x00FF),
new EncodingInfo("EBCDIC-CP-CH", "Cp500", 0x00FF),
new EncodingInfo("EBCDIC-CP-ROECE", "Cp870", 0x00FF),
new EncodingInfo("EBCDIC-CP-YU", "Cp870", 0x00FF),
new EncodingInfo("EBCDIC-CP-IS", "Cp871", 0x00FF),
new EncodingInfo("EBCDIC-CP-AR2", "Cp918", 0x00FF),
new EncodingInfo("MacRoman", "MacTEC", 0xFF),
new EncodingInfo("ASCII", "ASCII", 0x7F),
new EncodingInfo("ISO-Latin-1", "ASCII", 0xFF),
new EncodingInfo("UTF-8", "UTF8", 0xFFFF),
new EncodingInfo("UNICODE", "Unicode", 0xFFFF),
new EncodingInfo("UTF-16", "Unicode", 0xFFFF)


En dit is de alias-lijst uit de sun.io.CharacterEncoding class:

hashmap.put("us-ascii", "ASCII");
hashmap.put("ascii", "ASCII");
hashmap.put("646", "ASCII");
hashmap.put("iso_646.irv:1983", "ASCII");
hashmap.put("ansi_x3.4-1968", "ASCII");
hashmap.put("iso646-us", "ASCII");
hashmap.put("default", "ASCII");
hashmap.put("ascii7", "ASCII");
hashmap.put("8859_1", "ISO8859_1");
hashmap.put("iso_8859-1:1987", "ISO8859_1");
hashmap.put("iso-ir-100", "ISO8859_1");
hashmap.put("iso_8859-1", "ISO8859_1");
hashmap.put("iso-8859-1", "ISO8859_1");
hashmap.put("iso8859-1", "ISO8859_1");
hashmap.put("latin1", "ISO8859_1");
hashmap.put("l1", "ISO8859_1");
hashmap.put("ibm819", "ISO8859_1");
hashmap.put("ibm-819", "ISO8859_1");
hashmap.put("cp819", "ISO8859_1");
hashmap.put("819", "ISO8859_1");
hashmap.put("csisolatin1", "ISO8859_1");
hashmap.put("8859_2", "ISO8859_2");
hashmap.put("iso_8859-2:1987", "ISO8859_2");
hashmap.put("iso-ir-101", "ISO8859_2");
hashmap.put("iso_8859-2", "ISO8859_2");
hashmap.put("iso-8859-2", "ISO8859_2");
hashmap.put("iso8859-2", "ISO8859_2");
hashmap.put("latin2", "ISO8859_2");
hashmap.put("l2", "ISO8859_2");
hashmap.put("ibm912", "ISO8859_2");
hashmap.put("ibm-912", "ISO8859_2");
hashmap.put("cp912", "ISO8859_2");
hashmap.put("912", "ISO8859_2");
hashmap.put("csisolatin2", "ISO8859_2");
hashmap.put("8859_3", "ISO8859_3");
hashmap.put("iso_8859-3:1988", "ISO8859_3");
hashmap.put("iso-ir-109", "ISO8859_3");
hashmap.put("iso_8859-3", "ISO8859_3");
hashmap.put("iso-8859-3", "ISO8859_3");
hashmap.put("iso8859-3", "ISO8859_3");
hashmap.put("latin3", "ISO8859_3");
hashmap.put("l3", "ISO8859_3");
hashmap.put("ibm913", "ISO8859_3");
hashmap.put("ibm-913", "ISO8859_3");
hashmap.put("cp913", "ISO8859_3");
hashmap.put("913", "ISO8859_3");
hashmap.put("csisolatin3", "ISO8859_3");
hashmap.put("8859_4", "ISO8859_4");
hashmap.put("iso_8859-4:1988", "ISO8859_4");
hashmap.put("iso-ir-110", "ISO8859_4");
hashmap.put("iso_8859-4", "ISO8859_4");
hashmap.put("iso-8859-4", "ISO8859_4");
hashmap.put("iso8859-4", "ISO8859_4");
hashmap.put("latin4", "ISO8859_4");
hashmap.put("l4", "ISO8859_4");
hashmap.put("ibm914", "ISO8859_4");
hashmap.put("ibm-914", "ISO8859_4");
hashmap.put("cp914", "ISO8859_4");
hashmap.put("914", "ISO8859_4");
hashmap.put("csisolatin4", "ISO8859_4");
hashmap.put("8859_5", "ISO8859_5");
hashmap.put("iso_8859-5:1988", "ISO8859_5");
hashmap.put("iso-ir-144", "ISO8859_5");
hashmap.put("iso_8859-5", "ISO8859_5");
hashmap.put("iso-8859-5", "ISO8859_5");
hashmap.put("iso8859-5", "ISO8859_5");
hashmap.put("cyrillic", "ISO8859_5");
hashmap.put("csisolatincyrillic", "ISO8859_5");
hashmap.put("ibm915", "ISO8859_5");
hashmap.put("ibm-915", "ISO8859_5");
hashmap.put("cp915", "ISO8859_5");
hashmap.put("915", "ISO8859_5");
hashmap.put("8859_6", "ISO8859_6");
hashmap.put("iso_8859-6:1987", "ISO8859_6");
hashmap.put("iso-ir-127", "ISO8859_6");
hashmap.put("iso_8859-6", "ISO8859_6");
hashmap.put("iso-8859-6", "ISO8859_6");
hashmap.put("iso8859-6", "ISO8859_6");
hashmap.put("ecma-114", "ISO8859_6");
hashmap.put("asmo-708", "ISO8859_6");
hashmap.put("arabic", "ISO8859_6");
hashmap.put("csisolatinarabic", "ISO8859_6");
hashmap.put("ibm1089", "ISO8859_6");
hashmap.put("ibm-1089", "ISO8859_6");
hashmap.put("cp1089", "ISO8859_6");
hashmap.put("1089", "ISO8859_6");
hashmap.put("8859_7", "ISO8859_7");
hashmap.put("iso_8859-7:1987", "ISO8859_7");
hashmap.put("iso-ir-126", "ISO8859_7");
hashmap.put("iso_8859-7", "ISO8859_7");
hashmap.put("iso-8859-7", "ISO8859_7");
hashmap.put("iso8859-7", "ISO8859_7");
hashmap.put("elot_928", "ISO8859_7");
hashmap.put("ecma-118", "ISO8859_7");
hashmap.put("greek", "ISO8859_7");
hashmap.put("greek8", "ISO8859_7");
hashmap.put("csisolatingreek", "ISO8859_7");
hashmap.put("ibm813", "ISO8859_7");
hashmap.put("ibm-813", "ISO8859_7");
hashmap.put("cp813", "ISO8859_7");
hashmap.put("813", "ISO8859_7");
hashmap.put("8859_8", "ISO8859_8");
hashmap.put("iso_8859-8:1988", "ISO8859_8");
hashmap.put("iso-ir-138", "ISO8859_8");
hashmap.put("iso_8859-8", "ISO8859_8");
hashmap.put("iso-8859-8", "ISO8859_8");
hashmap.put("iso8859-8", "ISO8859_8");
hashmap.put("hebrew", "ISO8859_8");
hashmap.put("csisolatinhebrew", "ISO8859_8");
hashmap.put("ibm916", "ISO8859_8");
hashmap.put("ibm-916", "ISO8859_8");
hashmap.put("cp916", "ISO8859_8");
hashmap.put("916", "ISO8859_8");
hashmap.put("8859_9", "ISO8859_9");
hashmap.put("iso-ir-148", "ISO8859_9");
hashmap.put("iso_8859-9", "ISO8859_9");
hashmap.put("iso-8859-9", "ISO8859_9");
hashmap.put("iso8859-9", "ISO8859_9");
hashmap.put("latin5", "ISO8859_9");
hashmap.put("l5", "ISO8859_9");
hashmap.put("ibm920", "ISO8859_9");
hashmap.put("ibm-920", "ISO8859_9");
hashmap.put("cp920", "ISO8859_9");
hashmap.put("920", "ISO8859_9");
hashmap.put("csisolatin5", "ISO8859_9");
hashmap.put("8859_13", "ISO8859_13");
hashmap.put("iso_8859-13", "ISO8859_13");
hashmap.put("iso-8859-13", "ISO8859_13");
hashmap.put("iso8859-13", "ISO8859_13");
hashmap.put("8859_15", "ISO8859_15");
hashmap.put("iso-8859-15", "ISO8859_15");
hashmap.put("iso_8859-15", "ISO8859_15");
hashmap.put("iso8859-15", "ISO8859_15");
hashmap.put("ibm923", "ISO8859_15");
hashmap.put("ibm-923", "ISO8859_15");
hashmap.put("cp923", "ISO8859_15");
hashmap.put("923", "ISO8859_15");
hashmap.put("latin0", "ISO8859_15");
hashmap.put("latin9", "ISO8859_15");
hashmap.put("csisolatin0", "ISO8859_15");
hashmap.put("csisolatin9", "ISO8859_15");
hashmap.put("iso8859_15_fdis", "ISO8859_15");
hashmap.put("utf-8", "UTF8");
hashmap.put("unicode-1-1-utf-8", "UTF8");
hashmap.put("unicode-1-1", "UnicodeBigUnmarked");
hashmap.put("iso-10646-ucs-2", "UnicodeBigUnmarked");
hashmap.put("utf-16be", "UnicodeBigUnmarked");
hashmap.put("utf-16le", "UnicodeLittleUnmarked");
hashmap.put("utf-16", "UTF16");
hashmap.put("x-utf-16be", "UnicodeBigUnmarked");
hashmap.put("x-utf-16le", "UnicodeLittleUnmarked");
hashmap.put("unicode", "Unicode");
hashmap.put("ibm037", "Cp037");
hashmap.put("ibm-037", "Cp037");
hashmap.put("cp037", "Cp037");
hashmap.put("037", "Cp037");
hashmap.put("ibm273", "Cp273");
hashmap.put("ibm-273", "Cp273");
hashmap.put("cp273", "Cp273");
hashmap.put("273", "Cp273");
hashmap.put("ibm277", "Cp277");
hashmap.put("ibm-277", "Cp277");
hashmap.put("cp277", "Cp277");
hashmap.put("277", "Cp277");
hashmap.put("ibm278", "Cp278");
hashmap.put("ibm-278", "Cp278");
hashmap.put("cp278", "Cp278");
hashmap.put("278", "Cp278");
hashmap.put("ibm280", "Cp280");
hashmap.put("ibm-280", "Cp280");
hashmap.put("cp280", "Cp280");
hashmap.put("280", "Cp280");
hashmap.put("ibm284", "Cp284");
hashmap.put("ibm-284", "Cp284");
hashmap.put("cp284", "Cp284");
hashmap.put("284", "Cp284");
hashmap.put("ibm285", "Cp285");
hashmap.put("ibm-285", "Cp285");
hashmap.put("cp285", "Cp285");
hashmap.put("285", "Cp285");
hashmap.put("ibm297", "Cp297");
hashmap.put("ibm-297", "Cp297");
hashmap.put("cp297", "Cp297");
hashmap.put("297", "Cp297");
hashmap.put("ibm420", "Cp420");
hashmap.put("ibm-420", "Cp420");
hashmap.put("cp420", "Cp420");
hashmap.put("420", "Cp420");
hashmap.put("ibm424", "Cp424");
hashmap.put("ibm-424", "Cp424");
hashmap.put("cp424", "Cp424");
hashmap.put("424", "Cp424");
hashmap.put("ibm437", "Cp437");
hashmap.put("ibm-437", "Cp437");
hashmap.put("cp437", "Cp437");
hashmap.put("437", "Cp437");
hashmap.put("cspc8codepage437", "Cp437");
hashmap.put("ibm500", "Cp500");
hashmap.put("ibm-500", "Cp500");
hashmap.put("cp500", "Cp500");
hashmap.put("500", "Cp500");
hashmap.put("ibm737", "Cp737");
hashmap.put("ibm-737", "Cp737");
hashmap.put("cp737", "Cp737");
hashmap.put("737", "Cp737");
hashmap.put("ibm775", "Cp775");
hashmap.put("ibm-775", "Cp775");
hashmap.put("cp775", "Cp775");
hashmap.put("775", "Cp775");
hashmap.put("ibm838", "Cp838");
hashmap.put("ibm-838", "Cp838");
hashmap.put("cp838", "Cp838");
hashmap.put("838", "Cp838");
hashmap.put("ibm850", "Cp850");
hashmap.put("ibm-850", "Cp850");
hashmap.put("cp850", "Cp850");
hashmap.put("850", "Cp850");
hashmap.put("cspc850multilingual", "Cp850");
hashmap.put("ibm852", "Cp852");
hashmap.put("ibm-852", "Cp852");
hashmap.put("cp852", "Cp852");
hashmap.put("852", "Cp852");
hashmap.put("cspcp852", "Cp852");
hashmap.put("ibm855", "Cp855");
hashmap.put("ibm-855", "Cp855");
hashmap.put("cp855", "Cp855");
hashmap.put("855", "Cp855");
hashmap.put("cspcp855", "Cp855");
hashmap.put("ibm856", "Cp856");
hashmap.put("ibm-856", "Cp856");
hashmap.put("cp856", "Cp856");
hashmap.put("856", "Cp856");
hashmap.put("ibm857", "Cp857");
hashmap.put("ibm-857", "Cp857");
hashmap.put("cp857", "Cp857");
hashmap.put("857", "Cp857");
hashmap.put("csibm857", "Cp857");
hashmap.put("ibm860", "Cp860");
hashmap.put("ibm-860", "Cp860");
hashmap.put("cp860", "Cp860");
hashmap.put("860", "Cp860");
hashmap.put("csibm860", "Cp860");
hashmap.put("ibm861", "Cp861");
hashmap.put("ibm-861", "Cp861");
hashmap.put("cp861", "Cp861");
hashmap.put("cp-is", "Cp861");
hashmap.put("861", "Cp861");
hashmap.put("csibm861", "Cp861");
hashmap.put("ibm862", "Cp862");
hashmap.put("ibm-862", "Cp862");
hashmap.put("cp862", "Cp862");
hashmap.put("862", "Cp862");
hashmap.put("cspc862latinhebrew", "Cp862");
hashmap.put("ibm863", "Cp863");
hashmap.put("ibm-863", "Cp863");
hashmap.put("cp863", "Cp863");
hashmap.put("863", "Cp863");
hashmap.put("csibm863", "Cp863");
hashmap.put("ibm864", "Cp864");
hashmap.put("ibm-864", "Cp864");
hashmap.put("cp864", "Cp864");
hashmap.put("csibm864", "Cp864");
hashmap.put("ibm865", "Cp865");
hashmap.put("ibm-865", "Cp865");
hashmap.put("cp865", "Cp865");
hashmap.put("865", "Cp865");
hashmap.put("csibm865", "Cp865");
hashmap.put("ibm866", "Cp866");
hashmap.put("ibm-866", "Cp866");
hashmap.put("cp866", "Cp866");
hashmap.put("866", "Cp866");
hashmap.put("csibm866", "Cp866");
hashmap.put("ibm868", "Cp868");
hashmap.put("ibm-868", "Cp868");
hashmap.put("cp868", "Cp868");
hashmap.put("868", "Cp868");
hashmap.put("ibm869", "Cp869");
hashmap.put("ibm-869", "Cp869");
hashmap.put("cp869", "Cp869");
hashmap.put("869", "Cp869");
hashmap.put("cp-gr", "Cp869");
hashmap.put("csibm869", "Cp869");
hashmap.put("ibm870", "Cp870");
hashmap.put("ibm-870", "Cp870");
hashmap.put("cp870", "Cp870");
hashmap.put("870", "Cp870");
hashmap.put("ibm871", "Cp871");
hashmap.put("ibm-871", "Cp871");
hashmap.put("cp871", "Cp871");
hashmap.put("871", "Cp871");
hashmap.put("ibm874", "Cp874");
hashmap.put("ibm-874", "Cp874");
hashmap.put("cp874", "Cp874");
hashmap.put("874", "Cp874");
hashmap.put("ibm875", "Cp875");
hashmap.put("ibm-875", "Cp875");
hashmap.put("cp875", "Cp875");
hashmap.put("875", "Cp875");
hashmap.put("ibm918", "Cp918");
hashmap.put("ibm-918", "Cp918");
hashmap.put("cp918", "Cp918");
hashmap.put("918", "Cp918");
hashmap.put("ibm921", "Cp921");
hashmap.put("ibm-921", "Cp921");
hashmap.put("cp921", "Cp921");
hashmap.put("921", "Cp921");
hashmap.put("ibm922", "Cp922");
hashmap.put("ibm-922", "Cp922");
hashmap.put("cp922", "Cp922");
hashmap.put("922", "Cp922");
hashmap.put("ibm930", "Cp930");
hashmap.put("ibm-930", "Cp930");
hashmap.put("cp930", "Cp930");
hashmap.put("930", "Cp930");
hashmap.put("ibm933", "Cp933");
hashmap.put("ibm-933", "Cp933");
hashmap.put("cp933", "Cp933");
hashmap.put("933", "Cp933");
hashmap.put("ibm935", "Cp935");
hashmap.put("ibm-935", "Cp935");
hashmap.put("cp935", "Cp935");
hashmap.put("935", "Cp935");
hashmap.put("ibm937", "Cp937");
hashmap.put("ibm-937", "Cp937");
hashmap.put("cp937", "Cp937");
hashmap.put("937", "Cp937");
hashmap.put("ibm939", "Cp939");
hashmap.put("ibm-939", "Cp939");
hashmap.put("cp939", "Cp939");
hashmap.put("939", "Cp939");
hashmap.put("ibm942", "Cp942");
hashmap.put("ibm-942", "Cp942");
hashmap.put("cp942", "Cp942");
hashmap.put("942", "Cp942");
hashmap.put("ibm943", "Cp943");
hashmap.put("ibm-943", "Cp943");
hashmap.put("cp943", "Cp943");
hashmap.put("943", "Cp943");
hashmap.put("ibm948", "Cp948");
hashmap.put("ibm-948", "Cp948");
hashmap.put("cp948", "Cp948");
hashmap.put("948", "Cp948");
hashmap.put("ibm949", "Cp949");
hashmap.put("ibm-949", "Cp949");
hashmap.put("cp949", "Cp949");
hashmap.put("949", "Cp949");
hashmap.put("ibm950", "Cp950");
hashmap.put("ibm-950", "Cp950");
hashmap.put("cp950", "Cp950");
hashmap.put("950", "Cp950");
hashmap.put("ibm964", "Cp964");
hashmap.put("ibm-964", "Cp964");
hashmap.put("cp964", "Cp964");
hashmap.put("964", "Cp964");
hashmap.put("ibm970", "Cp970");
hashmap.put("ibm-970", "Cp970");
hashmap.put("cp970", "Cp970");
hashmap.put("970", "Cp970");
hashmap.put("ibm1006", "Cp1006");
hashmap.put("ibm-1006", "Cp1006");
hashmap.put("cp1006", "Cp1006");
hashmap.put("1006", "Cp1006");
hashmap.put("ibm1025", "Cp1025");
hashmap.put("ibm-1025", "Cp1025");
hashmap.put("cp1025", "Cp1025");
hashmap.put("1025", "Cp1025");
hashmap.put("ibm1026", "Cp1026");
hashmap.put("ibm-1026", "Cp1026");
hashmap.put("cp1026", "Cp1026");
hashmap.put("1026", "Cp1026");
hashmap.put("ibm1097", "Cp1097");
hashmap.put("ibm-1097", "Cp1097");
hashmap.put("cp1097", "Cp1097");
hashmap.put("1097", "Cp1097");
hashmap.put("ibm1098", "Cp1098");
hashmap.put("ibm-1098", "Cp1098");
hashmap.put("cp1098", "Cp1098");
hashmap.put("1098", "Cp1098");
hashmap.put("ibm1112", "Cp1112");
hashmap.put("ibm-1112", "Cp1112");
hashmap.put("cp1112", "Cp1112");
hashmap.put("1112", "Cp1112");
hashmap.put("ibm1122", "Cp1122");
hashmap.put("ibm-1122", "Cp1122");
hashmap.put("cp1122", "Cp1122");
hashmap.put("1122", "Cp1122");
hashmap.put("ibm1123", "Cp1123");
hashmap.put("ibm-1123", "Cp1123");
hashmap.put("cp1123", "Cp1123");
hashmap.put("1123", "Cp1123");
hashmap.put("ibm1124", "Cp1124");
hashmap.put("ibm-1124", "Cp1124");
hashmap.put("cp1124", "Cp1124");
hashmap.put("1124", "Cp1124");
hashmap.put("ibm1381", "Cp1381");
hashmap.put("ibm-1381", "Cp1381");
hashmap.put("cp1381", "Cp1381");
hashmap.put("1381", "Cp1381");
hashmap.put("ibm1383", "Cp1383");
hashmap.put("ibm-1383", "Cp1383");
hashmap.put("cp1383", "Cp1383");
hashmap.put("1383", "Cp1383");
hashmap.put("jis auto detect", "JISAutoDetect");
hashmap.put("jis", "ISO2022JP");
hashmap.put("iso-2022-jp", "ISO2022JP");
hashmap.put("csiso2022jp", "ISO2022JP");
hashmap.put("jis_encoding", "ISO2022JP");
hashmap.put("csjisencoding", "ISO2022JP");
hashmap.put("shift_jis", "MS932");
hashmap.put("ms_kanji", "MS932");
hashmap.put("csshiftjis", "MS932");
hashmap.put("windows-31j", "MS932");
hashmap.put("cswindows31j", "MS932");
hashmap.put("x-sjis", "MS932");
hashmap.put("\u30B7\u30D5\u30C8\u7B26\u53F7\u5316\u8868\u73FE", "SJIS");
hashmap.put("pck", "SJIS");
hashmap.put("eucjis", "EUC_JP");
hashmap.put("euc-jp", "EUC_JP");
hashmap.put("eucjp", "EUC_JP");
hashmap.put("extended_unix_code_packed_format_for_japanese", "EUC_JP");
hashmap.put("cseucpkdfmtjapanese", "EUC_JP");
hashmap.put("x-euc-jp", "EUC_JP");
hashmap.put("x-eucjp", "EUC_JP");
hashmap.put("euc-jp-linux", "EUC_JP_LINUX");
hashmap.put("windows-874", "MS874");
hashmap.put("windows-1250", "Cp1250");
hashmap.put("windows-1251", "Cp1251");
hashmap.put("ansi-1251", "Cp1251");
hashmap.put("windows-1252", "Cp1252");
hashmap.put("windows-1253", "Cp1253");
hashmap.put("windows-1254", "Cp1254");
hashmap.put("windows-1255", "Cp1255");
hashmap.put("windows-1256", "Cp1256");
hashmap.put("windows-1257", "Cp1257");
hashmap.put("windows-1258", "Cp1258");
hashmap.put("ibm33722", "Cp33722");
hashmap.put("ibm-33722", "Cp33722");
hashmap.put("cp33722", "Cp33722");
hashmap.put("33722", "Cp33722");
hashmap.put("koi8-r", "KOI8_R");
hashmap.put("koi8", "KOI8_R");
hashmap.put("cskoi8r", "KOI8_R");
hashmap.put("gb2312", "EUC_CN");
hashmap.put("gb2312-80", "EUC_CN");
hashmap.put("gb2312-1980", "EUC_CN");
hashmap.put("euc-cn", "EUC_CN");
hashmap.put("euccn", "EUC_CN");
hashmap.put("big5", "Big5");
hashmap.put("big5hk", "Big5_HKSCS");
hashmap.put("big5-hkscs", "Big5_HKSCS");
hashmap.put("big5-hkscs:unicode3.0", "Big5_HKSCS");
hashmap.put("big5_solaris", "Big5_Solaris");
hashmap.put("cns11643", "EUC_TW");
hashmap.put("euc-tw", "EUC_TW");
hashmap.put("euctw", "EUC_TW");
hashmap.put("ksc5601", "EUC_KR");
hashmap.put("euc-kr", "EUC_KR");
hashmap.put("euckr", "EUC_KR");
hashmap.put("ks_c_5601-1987", "EUC_KR");
hashmap.put("ksc5601-1987", "EUC_KR");
hashmap.put("ksc5601_1987", "EUC_KR");
hashmap.put("ksc_5601", "EUC_KR");
hashmap.put("5601", "EUC_KR");
hashmap.put("ksc5601-1992", "Johab");
hashmap.put("ksc5601_1992", "Johab");
hashmap.put("ms1361", "Johab");
hashmap.put("windows-949", "MS949");
hashmap.put("iso-2022-kr", "ISO2022KR");
hashmap.put("csiso2022kr", "ISO2022KR");
hashmap.put("tis620.2533", "TIS620");
hashmap.put("tis-620", "TIS620");
hashmap.put("x-compound-text", "COMPOUND_TEXT");
hashmap.put("x11-compound_text", "COMPOUND_TEXT");
hashmap.put("cp942c", "Cp942C");
hashmap.put("cp943c", "Cp943C");
hashmap.put("cp949c", "Cp949C");
hashmap.put("iscii", "ISCII91");


In de nieuwe java-io package (nio) worden tenslotte de volgende aliassen toegepast (sun.nio.cs.StandardCharsets):

charset("US-ASCII", "US_ASCII", new String[] {
"iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "ASCII", "ISO646-US", "us", "IBM367", "cp367", "csASCII", "646",
"iso_646.irv:1983", "ANSI_X3.4-1968"
});
charset("UTF-8", "UTF_8", new String[] {
"UTF8"
});
charset("UTF-16", "UTF_16", new String[] {
"UTF_16"
});
charset("UTF-16BE", "UTF_16BE", new String[] {
"UTF_16BE", "ISO-10646-UCS-2", "X-UTF-16BE"
});
charset("UTF-16LE", "UTF_16LE", new String[] {
"UTF_16LE", "X-UTF-16LE"
});
charset("ISO-8859-1", "ISO_8859_1", new String[] {
"iso-ir-100", "ISO_8859-1", "latin1", "l1", "IBM819", "cp819", "csISOLatin1", "819", "IBM-819", "ISO8859_1",
"ISO_8859-1:1987", "ISO_8859_1", "8859_1", "ISO8859-1"
});
charset("ISO-8859-15", "ISO_8859_15", new String[] {
"ISO_8859-15", "8859_15", "ISO-8859-15", "ISO_8859-15", "ISO8859-15", "IBM923", "IBM-923", "cp923", "923", "LATIN0",
"LATIN9", "L9", "csISOlatin0", "csISOlatin9", "ISO8859_15_FDIS"
});
charset("windows-1252", "MS1252", new String[] {
"cp1252"
});

Let erop dat in deze laatste implementatie de Cp1252 en ISO8859-1 dus WEL verschillen...

Verwijderd

Topicstarter
Er indrukwekkend, die lijsten. Wellicht even uitleggen waar ik mee bezig ben:

Ik heb een HTML pagina in een emailtje. Dat verwerk ik (als tekstbestand) tot ik het op een gegeven moment naar XML ga omzetten, en deze XML transformeer naar HTML.

Ergens gaat het fout, en ik snap nog niet alles van die encodings. Mijn grootste vraag:
-Is ISO-8859-1 (Latin-1) gelijk aan Windows-1252
-Zo ja, waarom kan ik dan in IE bij View->Encoding beide kiezen.

  • mbravenboer
  • Registratie: Januari 2000
  • Laatst online: 06-11-2025
Doekman: Ergens gaat het fout, en ik snap nog niet alles van die encodings.
Wat gaat er fout dan? In principe hoef je bij het gebruik van XML niet percee je encoding op te geven. Waarom laat je het niet aan auto-detectie over?
-Is ISO-8859-1 (Latin-1) gelijk aan Windows-1252
Even zoeken leverde dit op:
Microsoft Windows uses an ISO 8859-1 compatible character set (Code Page 1252)
1. Which coding should I use for accented characters? Use the internationally standardized ISO-8859-1 character set to type accented characters. This character set contains all characters necessary to type (West) European languages. This encoding is also the preferred encoding on the Internet (where accepted - see below).

This character set is also used by AmigaDOS, MS-Windows (Code Page 1252 in Microsoft Speak.
Microsoft Windows uses an ISO 8859-1 compatible character set (Code Page 1252), as delivered in the US, Europe (except Eastern Europe) and Latin America. In Windows 3.1, Microsoft has added additional characters
in the 0x80-0x9F range
The essential problem is that common practice is to assume that the Windows 1252 codepage and charset iso-8859-1 are identical, even though they are not. Since our attempt to wage a solitary fight for charset purity seems to have failed, we have added an option to Agent to have it follow common practice. Thus, the default Languages Send As selection for codepage 1252 is now "Western Windows-compatible". This selection causes Agent to assume that codepage 1252 and charset iso-88591-1 are identical, and to effectively eliminate the charset warning. Charset purists are free to select one of the other "Western" options, which enforce strict RFC conformance.
Conclusie: ze lijken verrot veel op elkaar :) .
Zo ja, waarom kan ik dan in IE bij View->Encoding beide kiezen.
Omdat ze dus kennelijk niet helemaal gelijk zijn. Het fijne weet ik er helaas ook niet van. Ik vraag me wel af wat je aan het doen bent als deze verschillen een probleem opleveren :) .

Blog, Stratego/XT: Program Transformation, SDF: Syntax Definition, Nix: Software Deployment


Verwijderd

Topicstarter
Ik kwam het volgende nog tegen:
Windows Codepage #1252
iso-8859-1, except when 128-159 is used, use "Windows-1252"
Maar ik denk nu dat ik het werkende heb. Maar ik snap nog niet alles. Windows heeft Unicode support, en als ik met het filescriptingobject een textbestand save, kan ik inderdaad kiezen tussen "ascii" en unicode.

Maar als je 8-bit characters gebruikt (ook wel aangeduid als plain text), hoe gaat 'ie dan om met codepages. Ik neem aan op mijn systeem die iso-8859-1. Maar waar kun je dat instellen, bij regional-settings zie ik dus veel code-page ondersteuning, maar niet welke de default is.

Maar ik begin nu wel een overzicht te krijgen. De links die hier boven gepost staan, waren zeker handig.

Het verschil tussen iso-8859-1 en cp-1252 (windows), (bron):
You often see Microsoft Windows users (check out my code page survey) announcing their texts as being in ISO-8859-1 even when in fact they contain funny characters from the CP1252 superset (and they may become more since Microsoft has also added the Euro to their code pages), so here you have a Unix font for them.
Dat is dus het verschil....
Pagina: 1