Panagiotis Sidiropoulos wrote:
I still believe that you read data properly, it is just visual
components that can't display it. You can try to ShowMesssage() what you
read from the file just after reading it. You will see double byte
string. It is correct.
I think you have to use Unicode compatible visual components and
manipulate strings a double byte. If you are certain it is always
english text you could parse each string and throw away any characters
belong to LeadBytes set of chars, like this:
for nCounter := 1 to Length( cString ) do
if not cString[ nCounter ] in LeadBytes then
cNewString := cNewString + cString[ nCounter ];
Panagiotis
I have resolved it this way (dirty, but it works):
I have defined the file as file of char.
The code for loading from file looks like this:
repeat // begin to read from file
sLine := '';
repeat //read line
if EOF(f) then break;
read(f, temp); //read the usefull char
sLine := sLine + temp;
if EOF(f) then break;
read(f, dummy); //read the char that will not be used (00)
until AnsiContainsStr(sLine, #10);
Here goes the parser
Until EOF(f);
One must check for EOFs before every Read, or there will be exceptions
at the end of the file.
Thanks for the help
bobby
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives