Page 1 of 1

Charteditor does not show correct unicode characters

Posted: Mon Jun 01, 2009 9:17 pm
by 9350086
Hi,

I am using Delphi 2009 and TeeChart Pro 8.04. When I set the language
using e.g. TeeSetChinese the characters are not in Chinese (only strange characters are shown) for the tabs and buttons in the charteditor. However the series title is displayed correctly in Chinese in the charteditor. It works perfectly for e.g German and French, but not for Chinese, Greek and Japanese. Are there any unicode settings (or fonts) that I have missed for the charteditor? The Chinese characters are fine in the main program itself.

Thanks,

Thomas[/img]

Posted: Tue Jun 02, 2009 3:22 pm
by yeray
Hi Thomas,

Could you please check if the file teechinese.pas shows correct texts for you?

Posted: Tue Jun 02, 2009 8:09 pm
by 10550737
Hi Yeray,

It seems that teechinese.pas (and all other language files) are recognized as ansi type in Delphi (or e.g by Notepad). I can open the file using e.g. Word. Word will then ask for the coding and choosing "Chinese traditional (Big5)" will display chinese charaters correctly in Word.

Could it be that the utf8 bom is missing in the beginning of the file? Or should the files have been saved in unicode format instead of ansi from the beginning?

Note that I get the same error in your compiled example Tee8New.exe that I downloaded.

Thanks,
Thomas

Posted: Tue Jun 02, 2009 8:25 pm
by 10550737
Actually, TeeChinese.pas works (displays correct letters) if the UTF-8 bom sequence EF BB BF is added to the beginning of the file...

Thomas

Posted: Wed Jun 03, 2009 8:59 am
by 10550737
[Actually, TeeChinese.pas works (displays correct letters) if the UTF-8 bom sequence EF BB BF is added to the beginning of the file...]

Comment and clarification: The above was obtained by importing TeeChinese.pas into Word and choosing encoding "Chinese traditional (Big5)". After this, copy all text in the word document and paste it into Notepad and save as utf8. Open this file in Delphi 2009 and Chinese characters will be displayed correctly.

/Thomas

Posted: Wed Jun 03, 2009 9:28 am
by yeray
Hi Thomas,

It seems that using the ANSI TeeChinese.pas the characters aren't displayed correctly. I've opened the file with notepad in our korean machine and saved as UTF-8 and then I've used it (I've removed previous dcus and compiled versions of the file) and now the editor looks fine.

Could you please try it?

Posted: Wed Jun 03, 2009 10:08 am
by 10550737
Hi Yeray,

I guess this will be the same as importing it into Word and then copy-paste into Notepad and save it in utf-8. I did this with Chinese, Japanese, Russian, Greek and it looks good.

It would be nice if you could distribute all files (at least those dealing with international characters) in utf-8 instead of in ansi. After this, compiled programs with Delphi 9 (which reads both ansi and utf-8 source files) and TeeChart will be "unicodified" all the way and show correct text on every PC (no change of language/region required).

Thanks,
Thomas

Posted: Wed Jun 03, 2009 12:15 pm
by yeray
Hi Thomas,

Yes, this is a known problem that should be solved with v9. The problem comes when those files are modified through different programs and from different machines so we don't control directly if they are saved as utf or ansi.

Posted: Thu Jun 04, 2009 2:44 pm
by 10550737
Ok, thanks Yeray.

I guess a quick solution for users (until ver 9 comes with a fix) would be to open the language files in e.g. Word and choose correct encoding for each language, and copy/paste the text in Notepad and save as UTF-8.

Best regards,
Thomas