Feminine ordinalNot sign
ASCII 170 is ª on Windows and ¬ in old DOS.
ª (Feminine Ordinal) is byte 170 in Windows-1252, Unicode U+00AA. Besides ordinals like 1.ª, Portuguese uses it in abbreviations such as Sr.ª for senhora. To Unicode it's a letter, not punctuation. Its category is Lo, so \w, isalpha() and letters-only validation all accept it. Python goes a step further: identifiers are NFKC-normalized, which folds ª into a, so ª = 5 followed by print(a) prints 5. Old DOS had it too, at 166. In UTF-8 it's C2 AA, and the HTML entity is ª.
¬ (Not Sign) is byte 170 in code page 437, the original IBM PC character set, and maps to Unicode U+00AC. Windows-1252 has the feminine ordinal ª at 170, so a ¬ in DOS text reads as ª in Windows-1252, and a Spanish 1ª printed to a code page 437 console shows up as 1¬. Code page 850 kept ¬ at 170 too. Its mirror image ⌐ is byte 169.
#include <stdio.h>int main(void) {/* On Windows (code page 1252) byte 170 is ª.Modern terminals expect UTF-8, so print the code point, not the byte. */printf("\u00AA\n"); /* UTF-8: C2 AA */unsigned char b = 170; /* the raw Windows-1252 byte */printf("%d 0x%02X\n", b, b); /* 170 0xAA */return 0;}
#include <stdio.h>int main(void) {/* Byte 170 is ¬ only on a console using code page 437(chcp 437 on Windows, or DOSBox). On a UTF-8 terminal thelone byte 0xAA is invalid and prints as garbage, often �. */putchar(170);/* char is signed on x86, so a plain char holding 0xAA is -86.Use unsigned char when you compare or index by byte value. */char c = (char)170;unsigned char u = 170;printf("\n%d %d\n", c, u); /* -86 170 *//* Portable: print the Unicode character as UTF-8 instead. */printf("\u00AC\n"); /* C2 AC */return 0;}
¬ is also ASCII 172 on Windows, which has the full guide.
Unicode defines ª as a compatibility form of a plain a written raised, and NFKC and NFKD strip that formatting away. º gets the same treatment and becomes o, so 1.º piso ends up as 1.o piso. If you normalize to make search forgiving, store the NFKC version as a separate search key and keep the original for display, or use NFC, which leaves both alone.
Match the gender of the word the number stands for: ª for feminine, º for masculine. So la 3.ª planta but el 3.º piso, even though both mean the third floor. Primero and tercero shorten to primer and tercer before a masculine noun, and the abbreviation follows along: el 1.er puesto, el 3.er día.
1.ª. The RAE puts a period between the number and the raised letter, so 1.ª and 2.º are the correct forms and 1ª without the period isn't. Roman numerals never take the letter at all: it's la II Guerra Mundial, not la II.ª.
Excel on Windows reads a CSV that has no byte order mark in your Windows code page instead of UTF-8, so ª's two bytes C2 AA come out as  and ª. Save the file with a BOM and Excel detects UTF-8 on its own. From pandas that's `df.to_csv('out.csv', encoding='utf-8-sig')`, and Notepad offers UTF-8 with BOM in its Save As dialog.
Type ª. Superscript is formatting, so it's gone the moment the text lands somewhere plain, like a web form or a database, and 1.ª turns back into 1.a. A search for 1.ª won't find the formatted version either. A superscript a only holds up in a document that will only ever be printed.
Without a zero, Alt codes read the DOS table, where 170 is the not sign ¬. ª is 170 only in Windows-1252, so type Alt+0170, or use its DOS code, Alt+166. On a Spanish keyboard ª is Shift plus the º key, left of 1.
Without a zero, Alt codes read the DOS table, where 170 is the not sign ¬. ª is 170 only in Windows-1252, so type Alt+0170, or use its DOS code, Alt+166. On a Spanish keyboard ª is Shift plus the º key, left of 1.