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 

Στις 24-03-2006, ημέρα Παρ, και ώρα 22:09 +0100, ο/η bobby έγραψε:
> Panagiotis Sidiropoulos wrote: 
> > > Thanks for advices, but it seems that 'f: TextFile' and 'readln(f,
> > > some_variable)' is causing the problem, because 'label.caption :=
> > > some_variable' will give only squares on label.
> > >     
> > 
> > Squares on labels is a typical symptom when active font does not support
> > specific characters. What is OS anyway? Do visual components used
> > support Unicode?
> > 
> >   
> > > How can I change the code for loading the file, in order to get the
> > > lines loaded correctly?
> > >     
> > 
> > I don't think you can specify a codepage while ReadLn.
> > 
> > Panagiotis 
> > 
> > Στις 24-03-2006, ημέρα Παρ, και ώρα 21:13 +0100, ο/η bobby έγραψε:
> >   
> > > Panagiotis Sidiropoulos wrote: 
> > >     
> > > > I had such dificulties lately trying to manage Unicode texts. List
> > > > members guided me to use UTF...* set of functions to manipulate Unicode
> > > > strings and finally I got it. I'm not a high skilled programmer but
> > > > because I mostly deal with such texts (it is Greek you see) I may think
> > > > something. 
> > > > 
> > > > If it is on Windows visual component should support Unicode, your code
> > > > may have no problem. There are available such components. If it is on
> > > > Linux, I think you have to compile with gtk2 in order to get Unicode
> > > > support. In any case font used should also support alphabets used in
> > > > text.
> > > > 
> > > > * you can use UTF8Copy() instead of Copy(), UTF8Pos instead of Pos()
> > > > etc. This set of functions is implemented in lclproc.
> > > > 
> > > > Panagiotis
> > > > 
> > > > Στις 24-03-2006, ημέρα Παρ, και ώρα 20:17 +0100, ο/η bobby έγραψε:
> > > >   
> > > >       
> > > > > I desperate...
> > > > > I have a CSV log file that I need to parse into StringGrid, but the
> > > > > text 
> > > > > in file is in Unicode.
> > > > >     
> > > > >         
> > > > _________________________________________________________________
> > > >      To unsubscribe: mail [EMAIL PROTECTED] with
> > > >                 "unsubscribe" as the Subject
> > > >    archives at http://www.lazarus.freepascal.org/mailarchives
> > > > 
> > > >   
> > > >       
> > > Thanks for advices, but it seems that 'f: TextFile' and 'readln(f,
> > > some_variable)' is causing the problem, because 'label.caption :=
> > > some_variable' will give only squares on label.
> > > How can I change the code for loading the file, in order to get the
> > > lines loaded correctly?
> > > 
> > > 
> > > bobby
> > > _________________________________________________________________ To
> > > unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as
> > > the Subject archives at http://www.lazarus.freepascal.org/mailarchives
> > >     
> > 
> > _________________________________________________________________
> >      To unsubscribe: mail [EMAIL PROTECTED] with
> >                 "unsubscribe" as the Subject
> >    archives at http://www.lazarus.freepascal.org/mailarchives
> > 
> >   
> The OS is Windows XP, StringGrid is the standard StringGrid component
> from LCL.
> 
> There is no special characters in the CSV file, its English, but
> encoded as Unicode (not UTF-8) according to Text viewer in
> TotalCommander.
> The sample CSV file is attached.
> I want to parse it to StringGrid. Delimiter is the sign "|".
> I really don't have an idea how to solve this...
> 
> bobby

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to