Weird text file problem

For everything that's not in any way related to PureBasic. General chat etc...
Jellybean
User
User
Posts: 95
Joined: Wed Aug 24, 2005 7:33 pm

Post by Jellybean »

Those three bytes means that you have saves the file as UTF-8 instead of ANSI.
Image
See where it says ANSI. Make sure it doesn't say anything else.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Those three bytes means that you have saves the file as UTF-8 instead of ANSI

Ahhh, I see -- my Notepad "Save As" prompt does indeed have UTF-8 as
the default instead of ANSI. I changed it to ANSI and now it all works as
expected. Thanks for solving this for me! :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

It's a byte order mark. http://www.unicode.org/faq/utf_bom.html#BOM

I had to learn all about this when I was writing my unicode file handling procedures. I have this code posted under Tips & Tricks if you're interested. One of the functions is a SkipBOM() function that will seek past this field based on the type. UTF-8, UTF-16 and UTF-32 all have their own numbers. Plain ansi would have no BOM.

Hopefully nobody else already answered this. I just skimmed the replies quickly since I'm at work. >_>
Post Reply