开发者

after saving delphi form, it loses accented characters

开发者 https://www.devze.com 2023-01-20 11:17 出处:网络
I got some forms in Delphi 7 which I open in my IDE. Certain accented characters are not displayed correctly in the form and when I change a form containing such a character , the accent is lost.

I got some forms in Delphi 7 which I open in my IDE. Certain accented characters are not displayed correctly in the form and when I change a form containing such a character , the accent is lost.

E.g. something encoded as #337 a in dfm becomes u in the saved dfm

Can you tell what may be wrong?

开发者_StackOverflow中文版

update: Problem for fixed after I changed in Control Panel, Region and Language, Tab Formats. I changed the format from English to the language that has accented character.


Delphi 7 does not support Unicode, only ASCII. That's why the "extra" characters are not displayed.

The controls are capable of showing unicode (because Windows does). But the dfm files are still ASCII, and you have no guarantees about characters above 127. (And the VCL does not support them either).

You can switch to 2010 or 2011 (XE) for Unicode support.


In a non-unicode delphi version (delphi 7 for instance), if your current codepage supports a character, then Delphi will store your accent character into the DFM. If you reload on a system that is set to a different codepage, you won't see that character.

In a unicode Delphi (2009 or later) you will be able to store any codepoint you want into the DFMs.


AFAIR, all dfm content is encoded as UTF-8, in the dfm files produced by Delphi 7.

So you could be able to use whatever character you need.

But you need to set the proper Font CharSet property value for the component.

0

精彩评论

暂无评论...
验证码 换一张
取 消