Right single quoteUppercase AE ligature
ASCII 146 is ’ on Windows and Æ in old DOS.
’ (Right Single Quote) is byte 146 in Windows-1252, Unicode U+2019. It closes a single quote, and it's also the typographic apostrophe: smart-quote autocorrect turns the ' in don't into ’, and Unicode recommends it for apostrophes in running text. If you're here because of ’, that's this character's UTF-8 bytes E2 80 99 decoded as Windows-1252, where E2 is â, 80 is € and 99 is ™. When the page is fine and the stored text itself is mangled, Python reverses a single round of the mistake with s.encode('cp1252').decode('utf-8'), and the ftfy library can untangle longer chains. The other problem is that ’ and the ASCII apostrophe ' (0x27) are different characters. A search or grep for don't won't match don’t, and a string delimited with ’ in pasted code is a syntax error. Normalize one to the other before comparing user input. The HTML entity is ’.
Æ (Capital AE) is byte 146 in code page 437, the original IBM PC character set, and maps to Unicode U+00C6. Windows-1252 has the right single quote ’ at 146, the curly apostrophe, so the two swap whenever text crosses between the tables: Ære from a DOS file reads as ’re, and don’t printed to a code page 437 console shows up as donÆt. Code page 850 kept Æ at 146 too.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 146 is ’.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u2019\n"); /* UTF-8: E2 80 99 */unsigned char b = 146; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 146 0x92 */return 0;}
#include <stdio.h>int main(void) {/* Byte 146 is Æ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0x92 is invalid and prints as garbage, often �. */putchar(146);/* char is signed on x86, so a plain char holding 0x92 is -110.Use unsigned char when you compare or index by byte value. */char c = (char)146;unsigned char u = 146;printf("\n%d %d\n", c, u); /* -110 146 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u00C6\n"); /* C3 86 */return 0;}
Æ is also ASCII 198 on Windows, which has the full guide.
The text is Windows-1252, where ’ is the single byte 0x92, and it's being read as UTF-8, where that byte can't stand alone, so the reader swaps in �. Convert the text to UTF-8 at the point it enters your system, for example in PHP with `mb_convert_encoding($s, 'UTF-8', 'Windows-1252')`. CSV files exported from Excel are a frequent source.
iOS Smart Punctuation, which is on by default, turns the apostrophe into ’, and your validation only allows the straight '. Accept both in the pattern, for example `/^[\p{L}'’ -]+$/u`, and normalize ’ to ' before saving so lookups for the same name still match. Names like D’Angelo and N’Golo hit the same wall.
Both are in use, and so is the plain '. The practical difference is how software classifies them: ʼ (U+02BC) counts as a letter, so мʼясо stays one word for tools that split text into words, while ’ counts as punctuation and some of those tools break the word there. Whichever you publish, normalize all three forms to one before searching or comparing.
The program writes Windows-1252, where the curly apostrophe ’ is byte 146, and the console reads code page 437 or 850, where 146 is Æ. So don’t comes out as donÆt, while straight apostrophes survive because ' is plain ASCII. For text headed to a console or a log file, replacing ’ with ' before printing is the simplest fix.
The program writes Windows-1252, where the curly apostrophe ’ is byte 146, and the console reads code page 437 or 850, where 146 is Æ. So don’t comes out as donÆt, while straight apostrophes survive because ' is plain ASCII. For text headed to a console or a log file, replacing ’ with ' before printing is the simplest fix.