JDK (Java Development Kit) Tutorials
Dr. Herong Yang, Version 5.00

Character Set Encoding Maps - CP1252/Windows-1252

This section provides a tutorial example of analyzing and printing character set encoding maps for encoding: CP1252/Windows-1252, the default encoding for JDK on Windows systems.

Here is the output of my sample program, EncodingAnalyzer.java, for CP1252//Windows-1252 encoding:

Code Point > Byte Sequence - Code Point > Byte Sequence

0000 > 00 - 007F > 7F
0080 > 3F - 009F > 3F
00A0 > A0 - 00FF > FF
0100 > 3F - 0151 > 3F
0152 > 8C - 0152 > 8C
0153 > 9C - 0153 > 9C
0154 > 3F - 015F > 3F
0160 > 8A - 0160 > 8A
0161 > 9A - 0161 > 9A
0162 > 3F - 0177 > 3F
0178 > 9F - 0178 > 9F
0179 > 3F - 017C > 3F
017D > 8E - 017D > 8E
017E > 9E - 017E > 9E
017F > 3F - 0191 > 3F
0192 > 83 - 0192 > 83
0193 > 3F - 02C5 > 3F
02C6 > 88 - 02C6 > 88
02C7 > 3F - 02DB > 3F
02DC > 98 - 02DC > 98
02DD > 3F - 2012 > 3F
2013 > 96 - 2014 > 97
2015 > 3F - 2017 > 3F
2018 > 91 - 2019 > 92
201A > 82 - 201A > 82
201B > 3F - 201B > 3F
201C > 93 - 201D > 94
201E > 84 - 201E > 84
201F > 3F - 201F > 3F
2020 > 86 - 2021 > 87
2022 > 95 - 2022 > 95
2023 > 3F - 2025 > 3F
2026 > 85 - 2026 > 85
2027 > 3F - 202F > 3F
2030 > 89 - 2030 > 89
2031 > 3F - 2038 > 3F
2039 > 8B - 2039 > 8B
203A > 9B - 203A > 9B
203B > 3F - 20AB > 3F
20AC > 80 - 20AC > 80
20AD > 3F - 2121 > 3F
2122 > 99 - 2122 > 99
2123 > 3F - FFFF > 3F

The encoding map of CP1252//Windows-1252, which is the default encoding used by JDK for Windows systems, is not so simple:

  • The output sequence is always one byte.
  • It is backward compatible with US-ASCII.
  • Only one section, 0x00A0 - 0x00FF, in the 0x0080 - 0x00FF range is valid.
  • Only a small number of code points in the 0x0100 - 0xFFFF range is valid.

Last update: 2006.

Sections in This Chapter

Character Set Encoding Map Analyzer

Character Set Encoding Maps - US-ASCII and ISO-8859-1/Latin 1

Character Set Encoding Maps - CP1252/Windows-1252

Character Set Encoding Maps - Unicode UTF-8

Character Set Encoding Maps - Unicode UTF-16, UTF-16LE, UTF-16BE

Character Counter Program for Any Given Encoding

Character Set Encoding Comparison

Dr. Herong Yang, updated in 2008
Character Set Encoding Maps - CP1252/Windows-1252