[fpc-pascal] Please Help with inifile in WinCE (ReadSectionValues into stringlist)
epergola
epergola at hotmail.com
Sat Sep 12 08:30:02 CEST 2009
Hi
I have a small translation file (pure ASCII DOS text) written in Win32. I
copied it to the emulator with Activesync.
The file contains one sections ('f') in this format
[f]
'Language||idioma'. (etc.)
(i.e. the English test on the 1st half, the Spanish translation on the 2nd
half)
In the WinCE test program run on the emulator, I read it this way:
IniFile := TIniFile.Create(s) ;
tl:=TStringList.Create;
try
inifile.ReadSectionValues('f',tL);
for i:=0 to tl.Count-1 do begin
tl[i]:=ConvertEncoding(tl[i],GuessEncoding(tl[i]),EncodingAnsi);
memo1.lines.add(tl[i]);
Now all works fine when the (2nd half) Spanish part has only english
characters.
But when there are spanish special characters (accented A or O and similar)
the tl[]
line is not written to memo1 at all.
I assume the inifile in Wince is widestring UTF* encoded, so i tried to
convert it
to ansi encoding but AFTER the tl string list is already populated. Is this
the problem?
If so, what should I ReadSectionValues into different form TStringList?
If the problem is other, can anyone give me clue?
Thanks very much for any help
--
View this message in context: http://www.nabble.com/Please-Help-with-inifile-in-WinCE-%28ReadSectionValues-into-stringlist%29-tp25411974p25411974.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
More information about the fpc-pascal
mailing list