Three quartersBox bottom-right corner, double horizontal
ASCII 190 is ¾ on Windows and ╛ in old DOS.
¾ (Three Quarters) is byte 190 in Windows-1252, Unicode U+00BE. It's the last of the three fractions Windows-1252 carries, used for things like ¾ sleeves or a ¾ inch pipe, and old DOS never had it. If ¾ appears in the middle of a word, it isn't a fraction at all but a broken ž. Czech, Slovak or Slovenian text saved as ISO-8859-2 stores ž as 0xBE, which Windows-1252 displays as ¾, so muž shows up as mu¾. With an Å in front of it, as in muž, the source was UTF-8 instead. Reading the file with the right encoding fixes both. In UTF-8 the fraction itself is C2 BE, and the HTML entity is ¾.
╛ (Single Up, Double Left) is byte 190 in code page 437, the original IBM PC character set, and maps to Unicode U+255B. It's the bottom-right corner of a box with double top and bottom edges and single sides: ═ (205) comes in from the left and │ (179) comes down from above. On a web page, frames like this can show gaps between rows, because each vertical stroke only spans its own line box. Keep line-height close to 1 on the pre element that holds the frame. Code page 850 put ¥ on this byte. In UTF-8 it's E2 95 9B, and the HTML entity is ╛.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 190 is ¾.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00BE\n"); /* UTF-8: C2 BE */unsigned char b = 190; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 190 0xBE */return 0;}
#include <stdio.h>int main(void) {/* Byte 190 is ╛ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xBE is invalid and prints as garbage, often �. */putchar(190);/* char is signed on x86, so a plain char holding 0xBE is -66.Use unsigned char when you compare or index by byte value. */char c = (char)190;unsigned char u = 190;printf("\n%d %d\n", c, u); /* -66 190 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u255B\n"); /* E2 95 9B */return 0;}
The text is Windows-1250, the Central European Windows code page, which stores ľ as 0xBE, and it's being read as Windows-1252, where 0xBE is ¾. So the letter a stray ¾ replaces tells you the source: ľ points to Windows-1250, ž to ISO-8859-2. Decode with the matching table, `cp1250` or `iso-8859-2` in Python, and save the result as UTF-8.
Use two ranges, because the fractions live in two places: `[¼-¾⅐-⅞]`. ¼, ½ and ¾ sit together in Latin-1 at U+00BC to U+00BE, and the rest, from ⅐ to ⅞, are in the Number Forms block at U+2150 to U+215E. Skip \p{No} for this, since it also matches superscripts and circled digits.
Alt codes without a leading zero read your PC's DOS code page, where 190 is the box corner ╛ on a US setup and ¥ on a Western European one. Alt+0190 gives ¾ on both. Code page 850 keeps ¾ at 243, so Alt+243 works on Western European PCs, but on a US one the same code types ≤.
Alt codes without a leading zero read your PC's DOS code page, where 190 is the box corner ╛ on a US setup and ¥ on a Western European one. Alt+0190 gives ¾ on both. Code page 850 keeps ¾ at 243, so Alt+243 works on Western European PCs, but on a US one the same code types ≤.