Hi!
I have this code:
LOCAL a$="Test... writte this characters: áéíóúñ"
//Create a text file anf writte a$ content.
OPENFILE(1, "test.txt", FALSE)
WRITESTR 1, a$+"\r\n"
WRITELINE 1,a$
CLOSEFILE 1
My problem is with the special characters "áéíóúñ". When I open it with a text program I get chinese characters. I think is a encoding matter. How can I create the text file with UTF-8 encode?
You could be using the wrong editor!
I get Test... writte this characters: áéíóúñ in Notepad...
Thanks for testing MrTAToad. I have the same problem with notepad. Perhaps is my computer.... I'll check this out and post the solution here if I find it.
Can GLBasic save UTF-8?
Otherwise you will have to do some reading here I guess :-)
http://en.wikipedia.org/wiki/UTF-8
http://en.wikipedia.org/wiki/Byte_order_mark
Not natively no, but it couldn't be too hard to write a routine :)
Sorry for the delay ;)
I wrote a tiny library that can convert to/from utf-8:
http://www.glbasic.com/forum/index.php?topic=11367.0
Hi,
I'd want to have some library that can display CJK characters with TTF Fonts, if there's something like this or a paid DLC, I'd buy it.
The Hangul example works for diaply bitmap fonts well, but if GLB wirks with unicode directly, it'll be a big bonus.
I think, the TTF routines should go into GLBasic directly, and then we might be able to render TTF fonts using UTF-8 charset. But it's quite some work. Alternatively we might add a TTF library wrapper...