The character ñ (U + 00F1) is encoded using UTF-8 as two bytes 11000011 10110001 ( 0xC3 0xB1 ).
These two bytes are decoded using ISO 8859-1 as two ñ characters.
So, you most likely use UTF-8 to encode a character in bytes and ISO 8859-1 (Latin-1, as Simon assumed) to decode bytes as characters.
Nathan ryan
source share