sandbox
Windows-1252 sandbox (encode)
Convert a Unicode code point into a single Windows-1252 (CP1252) byte.
Accepts U+XXXX, 0xXX, decimal, or a single character.
U+20AC€
1 byteDecimal
8364
Hexadecimal
0x80
Binary
10000000
CP1252 range
Range 0x80 → 0x9F - the Microsoft extension: 27 printable characters like €, ™, —, smart quotes, ... This is where CP1252 differs from Latin-1 (which has C1 controls in that slot). 5 bytes remain unassigned: 0x81, 0x8D, 0x8F, 0x90, 0x9D.
Step-by-step breakdown
- 01
Read the byte value in binary
Code point
U+20ACisn't in an identity range. Look up the CP1252 table to find its byte between0x80and0x9F, then convert to binary.10000000 - 02
Convert to hexadecimal
The binary byte becomes its 2-digit hex value.
0x80