Hello everyone,
I recently upgraded to A8 (finally) and one of the first things I really wanted to do, was using the Unicode features.
Unfortunately it does not really work and I am not sure what I am doing wrong.
I have looked through the forum and I found some helpful topics but (and maybe I am just too stupid) I can't really solve my problem.
Here is a piece of coding for reading out some text of a .txt-file (ANSI coded) which I had used before upgrading to A8. (It is all still ANSI for showing how I did it before)
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
FONT* unifont = "Arial Unicode MS#30";
TEXT* display = {layer = 1; font = unifont;}
function main()
{
STRING* str = "";
var fhandle = file_open_read("unicodetext.txt");
//The "unicodetext.txt" contains one line of text: test = Cool sentence;
file_find(fhandle,"test");
file_str_readto(fhandle,str,";",200);
file_close(fhandle);
(display.pstring)[0] = str;
set(display,SHOW);
display.pos_x = 200;
display.pos_y = 300;
}
This code works fine. The .txt is opened, 'file_find' looks for "test" and then copies everything that follows in the string (str) until it reads the semicolon.
So on my screen I can read the following: ' = Cool sentence'
Now I want to do the same thing with a Unicode .txt.
So I opened up my notepad again and saved it just as before but with Unicode this time instead of ANSI.
Then I adjusted
file_str_readto to
file_str_readtow
Aaaaand it does not work. Nothing gets displayed.
Using "txt_loadw" for directly filling the TEXT-object would work, but I want to precisely select rows from a txt and not load everything at once.
How can I load text out of my Unicode .txt and display it by using the above method?
Is it possible?
Yours,
Yking