3 ms·
There are no ASCII characters > 127. ASCII is a 7-bit encoding. That's why you run into cp1252 all the time if you work with Western European languages, such
by adamtj 16y ago
There are no ASCII characters > 127. ASCII is a 7-bit encoding. That's why you run into cp1252 all the time if you work with Western European languages, such as English. cp1252 is an 8-bit superset of ASCII designed for Western European languages. I believe it's true that the first 256 unicode code points are actually cp1252, which implies that the first 128 code points correspond with ASCII.
- beaumartinez 16y agoWindows-1252 (cp1252) is similar to ISO-8859-1 (Latin-1), which is a subset of Unicode; both are a superset of ASCII. Windows-1252 however has a few characters mapped to different codepoints.
- adamtj 16y agoThat's right, thank you.
- est 16y ago> There are no ASCII characters > 127. ASCII is a 7-bit encoding. Then there is no reason Python using ASCII to handle 8bit byte and yield error.