Uppercase O with tildeBox top-left corner, double horizontal
ASCII 213 is Õ on Windows and ╒ in old DOS.
Õ (Capital O with Tilde) is byte 213 in Windows-1252, Unicode U+00D5. Estonian treats it as a vowel of its own and starts words with it, as in Õun (apple), and Portuguese needs it in capitals like NAÇÕES and LIÇÕES. UTF-8 stores it as C3 95, and 95 is the bullet • in Windows-1252, so mangled Portuguese reads NAÇÕES, with what looks like a list bullet in the middle of a word. The HTML entity is Õ.
╒ (Single Down, Double Right) is byte 213 in code page 437, the original IBM PC character set, and maps to Unicode U+2552. It's the top-left corner of a box with double top and bottom edges and single sides: ═ (205) runs right and │ (179) drops down. It opens every fancy_grid table from Python's tabulate. Code page 850 gave this byte to the Turkish dotless ı, so a frame drawn for 437 and read as 850 starts with what looks like a stray lowercase i: ı═══. In UTF-8 it's E2 95 92, and the HTML entity is ╒.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 213 is Õ.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00D5\n"); /* UTF-8: C3 95 */unsigned char b = 213; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 213 0xD5 */return 0;}
#include <stdio.h>int main(void) {/* Byte 213 is ╒ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xD5 is invalid and prints as garbage, often �. */putchar(213);/* char is signed on x86, so a plain char holding 0xD5 is -43.Use unsigned char when you compare or index by byte value. */char c = (char)213;unsigned char u = 213;printf("\n%d %d\n", c, u); /* -43 213 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u2552\n"); /* E2 95 92 */return 0;}
The text is UTF-8 but got decoded as Windows-1252. UTF-8 stores Õ as C3 95, and Windows-1252 reads those two bytes as à and •, so a heading like INFORMAÇÕES comes out as INFORMAÇÕES. If the original is gone and all you have is the garbled string, Python can undo it: `s.encode('cp1252').decode('utf-8')`. Run that once, and only on text you know was mangled this way.
Yes. In Estonian õ is a letter of its own with its own vowel sound, and the alphabet places it after W rather than next to O. That matters when you sort. A default sort files Õ with O, and a raw code point sort puts it after Ä, and neither matches Estonian order. Sort Estonian names with an Estonian collation such as et_EE.
The file holds code page 437 bytes and is being read as Windows-1252. There 213 is Õ, 205 is Í and 184 is ¸, so the top edge of a double-topped box turns into accented letters, and the │ sides (179) show up as ³. Convert the file once instead of patching it by hand: `iconv -f CP437 -t UTF-8 old.txt > new.txt`, then open the result as UTF-8.
Python is encoding the table as Windows-1252, which has no ╒, and ╒ is the very first character of a fancy_grid table. When writing to a file, open it with `encoding='utf-8'`. If the error comes from print() while output is redirected to a file, set the environment variable PYTHONUTF8=1 instead. Or switch to tablefmt="grid", which draws the same layout in plain ASCII.
The file holds code page 437 bytes and is being read as Windows-1252. There 213 is Õ, 205 is Í and 184 is ¸, so the top edge of a double-topped box turns into accented letters, and the │ sides (179) show up as ³. Convert the file once instead of patching it by hand: `iconv -f CP437 -t UTF-8 old.txt > new.txt`, then open the result as UTF-8.