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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode Display Problem

Status
Not open for further replies.

tim22

Programmer
Apr 12, 2006
3
GB
Hi,

my task is to import data from various sources (database, CSV, etc), import it into our database and recall it as necessary, with emphasis on the Unicode (UTF-8) data. I'm running D4 on XP Pro.

Everything is all in place except for the fact that I can't display the unicode properly. I've written a test program to load data from a file into various containers (StringLists, WideStringLists, various streams, etc.) and display them in Unicode Labels (written by our last programmer), and outputted back to other files.

The file output is absolutely fine but the label output isn't - text from the StringList always splits the character into two, and the Stream output just produces a long string of boxes and glyphs.

I moved to a different machine running D7 and replaced our Unicode labels with the TNTWare Unicode labels, but the effect is exactly the same.

I have set the labels to use a Unicode-enabled font with default_charset, I've tried various streams, widestring-casts, checked what codepage the system is using (850), I've activated all of the code page conversion tables, to no avail. The labels will display Unicode if I give them the decimal representation at design-time, however.

Is there anything I'm missing? Someone must have come across this problem before, and it's driving me nuts so please help!

Thanks very much in advance,

Tim
 
Basically my problem bubbles down to display - I can read in and output the files without any problems, but I can't print or display them properly:

unicodedisplayproblem7mk.jpg


Any ideas?

Tim
 
tonhu he did if you read

"I moved to a different machine running D7 and replaced our Unicode labels with the TNTWare Unicode labels, but the effect is exactly the same."


Aaron Taylor
John Mutch Electronics
 
Indeed. Our last programmer created a label which could display Unicode characters, and ExtTextOutW should itself be able to output Unicode text. It must be something I haven't configured/set properly in Delphi because other applications display it without any problems, but I can't think what it is!

Tim
 
Try
1. changing the charset and and font in the TnT label controls.

2. Try change the language settings "control panel -> regional and language settings -> advanced tab"
All non-unicode.... combobox change to your language.

I think it is because the file data you are reading from does not actually contain the font or codepage info so Tnt does not know what language it is.

Thats all I can suggest
 
Have you tried the "System" font? Fonts do occasionally
make difference.

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top