Page 1 of 1
Text file Displaying Special Characters
Posted: Tue Sep 22, 2009 7:36 am
by nmc.091
Hi experts,
When I open text file using text pad, some special characters are displaying at the beginning of the sentence.
ÿþ are displayed at the beginning of the sentence. How can I remove this?
Thanks,
Marc
Posted: Tue Sep 22, 2009 3:00 pm
by ben_josephs
The contents of your file are telling you that the text in the file is Unicode, that it is encoded in 16-bit (2-byte) units, and that the pairs of bytes are in the order lower then higher (Intel order).
ÿ (y with diaeresis) has the code 0xFF and þ (thorn) has the code 0xFE. Together they constitute the Unicode byte order mark (BOM) (U+FEFF) of a file encoded in UTF-16 (16 bits per character) with little endian byte order. The prgram that produced your file put them there. They are not part of the textual data of the file; they are an indication of how the bytes are to be interpreted as characters.
TextPad should have recognised the data as such and displayed its contents without the BOM. I don't know why it didn't. Perhaps the text isn't really Unicode.
If, when the file is active in TextPad, you open View | Document Properties | Document, what does it say under Code set?
If you open the file in binary mode, does it look as if its encoded as 2 bytes per character?