Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foreign Characters in ListBox

Status
Not open for further replies.

jaschulz

Programmer
May 20, 2005
89
FR
I load a TListBox from a text file with LoadFromFile. The source file contains some foreign characters (accented French vowels). They do not display properly in the text box (I have tried, literally, all the different CharSets). If I load the file in question with NotePad or WordPad I see the same problem. However if I load it with Notepad++ (See: all characters display properly. How can I get my app to behave like Notepad++.

Thanks,

JAS
 
it means that the textfile is saved as unicode. Delphi VCL controls are not unicode compatible. use the controls from tntware, they can do that. If believe the components are free.

look here :


-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Well, in fact I still don't get the right characters in the TntListBox. I am not doing anything fancy here, I load the file as follows:

TntListBox1.Items.LoadFromFile(destinationPathName + 'short list.m3u');

Any ideas?

JAS
 
Found the solution (didn't need TNT after all):

I just needed to run the strings in the list through the function UTF8toAnsi.

Thanks,

JAS
 
Glad you sorted it out!

//Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks for posting your findings!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top