Hi, Am Freitag, den 24.03.2006, 22:09 +0100 schrieb 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?
Make some_variable a WideString. > > > > > > > > > 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 There is no "unicode" encoding as far as I know. You/it probably mean UTF-16. some_variable is a WideString, yes? I'm not sure what lazarus accepts in label caption, but I think UTF-8. Thus try: label.caption := UTF8Encode(some_variable); > 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 cheers, Danny _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
