Left angle quotesOne half
ASCII 171 is « on Windows and ½ in old DOS.
« (Left Guillemet) is byte 171 in Windows-1252, Unicode U+00AB. It opens quotations in French, Spanish, Italian, Russian and Ukrainian, while German uses it as the closing mark: »so«. Spacing depends on the language. French puts a non-breaking space inside the marks, « comme ça », while Swiss German and Russian set them tight, «так». Two lookalikes get mixed up with it. ≪ (U+226A) is the math sign for much less than, and 《 (U+300A) is the Chinese bracket for book and film titles, not a quotation mark. Old DOS had « too, at 174. In UTF-8 it's C2 AB, and the HTML entity is «.
½ (One Half) is byte 171 in code page 437, the original IBM PC character set, and maps to Unicode U+00BD. Windows-1252 has the left guillemet « at 171, so DOS text read as Windows-1252 turns a 9½ shoe size into 9«. Code page 850 kept ½ at 171 too. Code page 437 has only two fractions, ½ here and ¼ next door at 172, while Windows-1252 adds ¾.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 171 is «.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00AB\n"); /* UTF-8: C2 AB */unsigned char b = 171; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 171 0xAB */return 0;}
#include <stdio.h>int main(void) {/* Byte 171 is ½ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xAB is invalid and prints as garbage, often �. */putchar(171);/* char is signed on x86, so a plain char holding 0xAB is -85.Use unsigned char when you compare or index by byte value. */char c = (char)171;unsigned char u = 171;printf("\n%d %d\n", c, u); /* -85 171 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u00BD\n"); /* C2 BD */return 0;}
½ is also ASCII 189 on Windows, which has the full guide.
Every « and » in UTF-8 starts with the byte C2, and a page decoded as Windows-1252 draws that C2 as Â. French doubles the damage, since the non-breaking space inside the marks is C2 A0, so « bonjour » comes out as « bonjour ». If the text comes from MySQL, check the connection first: add `charset=utf8mb4` to the PDO DSN, and serve the page as UTF-8.
In Russian and Ukrainian, „ “ (bytes 132 and 147 in Windows-1252), as in «Он сказал „нет“». German, which reverses the guillemets, nests with single ones pointing the same way: »Er sagte ›nein‹«. Those single guillemets are › at 155 and ‹ at 139.
Replace each pair with guillemets and put a non-breaking space inside each mark. In JavaScript that's `text.replace(/"([^"]*)"/g, '«\u00A0$1\u00A0»')`. It pairs quotes strictly in order, so one stray quote shifts every pair after it. Run it on prose only, away from HTML attributes and inch marks like 12".
Set the quotes property: `q:lang(fr) { quotes: "«\a0" "\a0»"; }` gives French guillemets with the non-breaking space included, for any <q> inside an element with lang="fr". Leave the marks out of the text itself, since the browser adds them. Some browsers pick quotes from lang alone, but declaring them yourself gives the same result in all of them.
Raku uses guillemets as syntax: «a b c» builds a list of words, and »+« applies + element by element across two lists. Raku also accepts << and >> as ASCII spellings of the same operators, which matters when your keyboard has no guillemets.
The file uses a DOS code page, where ½ is byte 171 and ¼ is 172, and it's being read as Windows-1252, which puts « and ¬ on those bytes. So a 3½" disk shows up as a 3«" disk. Convert it once in PowerShell: `Get-Content old.txt -Encoding Oem | Set-Content new.txt -Encoding UTF8`. Oem means your system's DOS code page, and both 437 and 850 keep the fractions at these bytes.
The file uses a DOS code page, where ½ is byte 171 and ¼ is 172, and it's being read as Windows-1252, which puts « and ¬ on those bytes. So a 3½" disk shows up as a 3«" disk. Convert it once in PowerShell: `Get-Content old.txt -Encoding Oem | Set-Content new.txt -Encoding UTF8`. Oem means your system's DOS code page, and both 437 and 850 keep the fractions at these bytes.