Lowercase n with tildePlus-minus sign
ASCII 241 is ñ on Windows and ± in old DOS.
ñ (Small N with Tilde) is byte 241 in Windows-1252, Unicode U+00F1. Spanish treats it as a letter of its own (año, niño, España), and Galician, Basque, Filipino and Guarani use it too. URLs are where it gets awkward. Slug generators that strip accents turn it into n, which turns año into ano, a different and unfortunate word, so a page about Feliz año nuevo ends up at /feliz-ano-nuevo. You don't have to strip it. Browsers and search engines handle non-ASCII paths: /año travels as /a%C3%B1o, the percent-encoded UTF-8 bytes, and the address bar shows the ñ again. If a slug has to be ASCII, choose the fallback deliberately instead of letting a library drop the tilde. Old DOS had ñ at 164. The UTF-8 bytes C3 B1 misread as ñ. The HTML entity is ñ.
± (Plus-Minus Sign) is byte 241 in code page 437, the original IBM PC character set, and maps to Unicode U+00B1. On Windows the same character sits at two different bytes, and that trips up C programs. Save a source file containing ±5% in Windows-1252 and the compiler stores the byte B1, but a console in code page 437 reads B1 as ▒, so the program prints ▒5%. The console expected 241. Going the other way, Windows-1252 reads 241 as ñ, so 5 ± 0.1 from a DOS file shows up as 5 ñ 0.1. Code page 850 kept ± here too.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 241 is ñ.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00F1\n"); /* UTF-8: C3 B1 */unsigned char b = 241; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 241 0xF1 */return 0;}
#include <stdio.h>int main(void) {/* Byte 241 is ± only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xF1 is invalid and prints as garbage, often �. */putchar(241);/* char is signed on x86, so a plain char holding 0xF1 is -15.Use unsigned char when you compare or index by byte value. */char c = (char)241;unsigned char u = 241;printf("\n%d %d\n", c, u); /* -15 241 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u00B1\n"); /* C2 B1 */return 0;}
± is also ASCII 177 on Windows, which has the full guide.
The column's collation is accent-insensitive, and collations like utf8mb4_0900_ai_ci and utf8mb4_unicode_ci compare ñ equal to n, so a unique key sees a clash. Switch the column to a Spanish collation: `utf8mb4_es_0900_ai_ci` on MySQL 8, or utf8mb4_spanish_ci on older versions. Both treat ñ as its own letter, and ORDER BY then puts it between n and o.
Your app connects to MySQL without setting a charset, so its UTF-8 text has been stored double-encoded, and the site only looks right because it reads through the same wrong connection. phpMyAdmin connects as utf8mb4 and shows what's really stored. Call `$db->set_charset('utf8mb4')` right after connecting, then convert the existing rows once, because fixing the connection alone makes the site show ñ too.
From medieval scribes saving space. They wrote a doubled nn as one n with a small mark above it, and that mark became the tilde, which is why año goes back to Latin annus. Spanish kept the letter for the ny sound, while Portuguese spells the same sound nh.
You change the word, and not in a nice way: año means year, while ano means anus. Feliz año nuevo is the one that belongs on a card. So never drop the tilde to get around a display problem. Fix the encoding instead, because the text itself was fine.
Short Alt codes use the DOS table, where 241 is the plus-minus sign. Type Alt+0241 for ñ and Alt+0209 for Ñ. The short code isn't wasted, though: Alt+241 is the quickest way to type ± when that's what you're after.
The file was saved in Windows-1252, and cmd's type command shows it through the console's DOS code page, where the ñ byte is ±. Read it with PowerShell instead: Windows PowerShell 5.1's Get-Content assumes the Windows code page for files without a BOM, so `Get-Content notas.txt` prints España correctly.
Short Alt codes use the DOS table, where 241 is the plus-minus sign. Type Alt+0241 for ñ and Alt+0209 for Ñ. The short code isn't wasted, though: Alt+241 is the quickest way to type ± when that's what you're after.
The file was saved in Windows-1252, and cmd's type command shows it through the console's DOS code page, where the ñ byte is ±. Read it with PowerShell instead: Windows PowerShell 5.1's Get-Content assumes the Windows code page for files without a BOM, so `Get-Content notas.txt` prints España correctly.