Lowercase a with tildeGreek small pi
ASCII 227 is ã on Windows and π in old DOS.
ã (Small A with Tilde) is byte 227 in Windows-1252, Unicode U+00E3. Portuguese can't do without it (não, mãe, São Paulo), and Vietnamese and Guarani use it too. Code page 437 had no ã at all, so Portuguese DOS systems used code page 850, which put ã on byte 198, or the Portuguese code page 860, which put it on byte 132, where 437 has ä. That's why a Brazilian code page 860 file opened as code page 437 says näo instead of não. In UTF-8, ã is C3 A3, which misreads as ã. The HTML entity is ã.
π (Pi) is byte 227 in code page 437, the original IBM PC character set, and maps to Unicode U+03C0. It's the circle constant in formulas like A = πr², and JavaScript and Python both accept it as a variable name, so const π = Math.PI is legal code. Its capital Π (U+03A0) has a lookalike in the product sign ∏ (U+220F). For a product over a range use ∏, which is drawn at operator size, while Π is sized as a letter. Code page 850 put Ò on this byte. In UTF-8, π is CF 80, and the HTML entity is π.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 227 is ã.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00E3\n"); /* UTF-8: C3 A3 */unsigned char b = 227; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 227 0xE3 */return 0;}
#include <stdio.h>int main(void) {/* Byte 227 is π only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xE3 is invalid and prints as garbage, often �. */putchar(227);/* char is signed on x86, so a plain char holding 0xE3 is -29.Use unsigned char when you compare or index by byte value. */char c = (char)227;unsigned char u = 227;printf("\n%d %d\n", c, u); /* -29 227 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u03C0\n"); /* CF 80 */return 0;}
utf8_encode() assumes its input is ISO-8859-1, so running it on text that's already UTF-8 encodes ã a second time and leaves não. Remove the call rather than adding a decode after it. The function is deprecated since PHP 8.2 anyway, and when you really do need to convert Latin-1, `mb_convert_encoding($s, 'UTF-8', 'ISO-8859-1')` states both encodings.
It marks a nasal vowel, the sound that separates não from a plain nao. Leaving it off can change the word entirely: manhã is morning, while manha means a tantrum or a trick. Portuguese spelling treats the tilde as required, so text without it is misspelled rather than informal.
The file is UTF-8 and your editor opened it as Windows-1252, so π's two bytes appear as Ï and €. In Notepad++, choose Encoding > Encode in UTF-8, which reinterprets the bytes. Don't pick Convert to UTF-8 at that point, because it would save the garbled Ï€ as real characters.
Excel reads π as an unknown name, not a number. Use the PI() function instead: =2*PI()*A1. PI() returns the constant to 15 significant digits, which is as far as Excel's precision goes anyway. The symbol itself is fine in labels and headers, just not inside the math.