Masculine ordinalDouble box vertical line
ASCII 186 is º on Windows and ║ in old DOS.
º (Masculine Ordinal) is byte 186 in Windows-1252, Unicode U+00BA. Portuguese uses it in dates: the first of the month is written 1º de maio in Brazil and 1.º de maio in Portugal, while every other day is a plain number. So a date parser written around 2 de maio can fail on the first day of every month. Strip the º, and the period before it, before parsing. It also forms the abbreviation nº for número, which isn't the same as the single numero sign № (U+2116) used in Russian and Ukrainian; Windows-1252 has no №. Old DOS had º too, at 167. In UTF-8 it's C2 BA, and the HTML entity is º.
║ (Double Vertical) is byte 186 in code page 437, the original IBM PC character set, and maps to Unicode U+2551. It's the side of a double-line frame, running between corners like ╔ (201) and ╚ (200). Fonts draw box pieces to fill the whole character cell so lines join from row to row, which is why ║ looks off outside a frame. For a norm in math, ‖v‖, the right character is ‖ (U+2016), and the click letter ǁ (U+01C1) is a third lookalike that search won't equate with either. In UTF-8 it's E2 95 91, which a code page 437 console shows as Γòæ. The HTML entity is ║.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 186 is º.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00BA\n"); /* UTF-8: C2 BA */unsigned char b = 186; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 186 0xBA */return 0;}
#include <stdio.h>int main(void) {/* Byte 186 is ║ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xBA is invalid and prints as garbage, often �. */putchar(186);/* char is signed on x86, so a plain char holding 0xBA is -70.Use unsigned char when you compare or index by byte value. */char c = (char)186;unsigned char u = 186;printf("\n%d %d\n", c, u); /* -70 186 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u2551\n"); /* E2 95 91 */return 0;}
No. 20º uses the ordinal indicator, not the degree sign, and search or parsing won't treat them as equal. The swap happens because Spanish keyboards have a key for º and none for °. Don't replace every º, since 2º can also mean segundo. Fix only the ones before C or F, as in `re.sub(r'(?<=\d)º(?=\s?[CF]\b)', '°', s)`.
Third floor, second door. The floor (piso) is masculine and takes º, and the door on that landing (puerta) is feminine and takes ª. So Calle Mayor 10, 3º 2ª means building 10, third floor, flat two. Some buildings name doors by side instead, as in 3º izq. or 3º dcha. for left and right.
Switch stdout to UTF-16 mode and write wide strings. After `_setmode(_fileno(stdout), _O_U16TEXT);` (from io.h and fcntl.h), a line like `std::wcout << L"\u2551";` draws ║ whatever code page the console is set to. The catch is that the stream then refuses narrow output, so don't mix in printf or std::cout calls after the switch.
Box-drawing characters have ambiguous East Asian width, so a terminal running in a CJK locale may draw them two columns wide, and every wall pushes the rest of the line to the right. Switch the terminal's ambiguous-width setting to narrow if it has one, and test your layout under that locale before shipping.
Use ∥ (U+2225), the math symbol for parallel, as in AB ∥ CD. Math software treats it as a relation between the two lines, and screen readers announce it by that name, while ║ gets read out as a box-drawing piece.