Readline - UTF-8 or Unicode or both?

BlitzMax Forums/BlitzMax Programming/Readline - UTF-8 or Unicode or both?

I am just wondering in what format does ReadLine read the characters in? Can it read Unicode text files?

Hi,

Not as yet - it just reads a byte-per-char so it's pretty much 'ascii' (or 'Latin1' by 'Max convention').

I have started work on a TextStream type though, and the next release of the compiler will be able to parse Latin1/UTF8/UTF16 source files. In addition, the Mac IDE will be able to save in Latin1/UTF8/UTF16 format. This was very easy to do on the Mac - I'm not sure when the Win32 IDE will catch up.

Hi,

I've been playing around with this tonight and having trouble. Have the above changed been implemented.

In my code I'm trying to compare a sting in my source with a string read from a file.

When the files is saved as standard 8 bit text I have no problem, however when the file is saved as Unicode 16 my seach string is not found.

Whats more, when I write to this unicode 16 file, latin characters from the source file are saved as some kind of asian glif?

Anybody know what I'm doing wrong?

So to clarify my question, does Readline read UTF 16 yet? It it still reading ascii? Will it ever?

I have started work on a TextStream type though, and the next release of the compiler will be able to parse Latin1/UTF8/UTF16 source files. In addition, the Mac IDE will be able to save in Latin1/UTF8/UTF16 format. This was very easy to do on the Mac - I'm not sure when the Win32 IDE will catch up.

Hi Mark,

Great thinking! So long as win can read them that will be fine as I am required to have local languages, ie Japanese in my game. It will be awesomely cool to see it.

OK new question, anybody know how to read raw bytes from a file and convert it to a Unicode 16 string :)