Lowercase a with umlautGreek capital sigma
ASCII 228 is ä on Windows and Σ in old DOS.
ä (Small A with Umlaut) is byte 228 in Windows-1252, Unicode U+00E4. German writes März and Käse with it, Swedish and Finnish treat it as a separate letter, and Slovak has it too. Email shows it in an odd form. Mail headers are ASCII-only, so a subject line like März travels as an encoded word, either =?UTF-8?Q?M=C3=A4rz?= with the UTF-8 bytes C3 A4 written as =C3=A4, or a Base64 variant marked ?B?. If a log, script or badly configured client prints that string raw, decode it with a MIME library such as Python's email.header.decode_header rather than by hand. Old DOS had ä at 132. The UTF-8 bytes C3 A4 misread as ä. The HTML entity is ä.
Σ (Capital Sigma) is byte 228 in code page 437, the original IBM PC character set, and maps to Unicode U+03A3. Maths uses it for sums, though Unicode also has a dedicated summation sign ∑ (U+2211). Lowercasing it is the tricky part. Greek has two small sigmas, σ inside a word and ς at the end, so the correct lowercase depends on position. Python's str.lower() handles that and turns ΟΔΟΣ into οδος, but code that lowercases one character at a time always produces σ. Code page 437 has σ at 229 and no ς at all. Code page 850 put õ on this byte. In UTF-8, Σ is CE A3, and the HTML entity is Σ.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 228 is ä.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00E4\n"); /* UTF-8: C3 A4 */unsigned char b = 228; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 228 0xE4 */return 0;}
#include <stdio.h>int main(void) {/* Byte 228 is Σ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xE4 is invalid and prints as garbage, often �. */putchar(228);/* char is signed on x86, so a plain char holding 0xE4 is -28.Use unsigned char when you compare or index by byte value. */char c = (char)228;unsigned char u = 228;printf("\n%d %d\n", c, u); /* -28 228 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u03A3\n"); /* CE A3 */return 0;}
Git quotes file names that contain bytes above 127 and writes each of those bytes in octal, so the UTF-8 bytes of ä, C3 A4, come out as \303\244. Turn it off once with `git config --global core.quotePath false` and git status prints the real name. The file itself was never damaged.
It depends on the language. Swedish and Finnish put ä near the end of the alphabet, after z and å, while German files it with a, so the same list sorts differently in Stockholm and Berlin. Sorting by code point matches neither. Pass the locale: `names.sort(new Intl.Collator('sv').compare)` for Swedish, and 'de' for German.
Reimport it and tell the import that the file is UTF-8. In LibreOffice Calc, the Text Import dialog that opens with a CSV has a Character set list, and choosing Unicode (UTF-8) there fixes the preview before anything is loaded. If the file comes from your own export, writing it with a BOM lets it open correctly without touching that setting.
The batch file was saved in Windows-1252, and cmd reads it through the console's DOS code page. On German Windows that's 850, where the ä byte is õ, and on US systems it's 437, where the same byte is Σ. Put `chcp 1252 >nul` as the first line, and cmd reads the rest of the file the way it was saved.
The batch file was saved in Windows-1252, and cmd reads it through the console's DOS code page. On German Windows that's 850, where the ä byte is õ, and on US systems it's 437, where the same byte is Σ. Put `chcp 1252 >nul` as the first line, and cmd reads the rest of the file the way it was saved.