views:

40

answers:

2

Hi,

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?

A: 

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.

Gamecat
To be honest I doubt this is entirely true. We are using Delphi 2006, which is not Unicode, and accents as in ´ do not get lost. For example, the word "Previsión" will be stored in the DFM as "Previsi'#243'n". As far as I can remember this was not an issue in Delphi 7, but I can not test it.
Guillem Vicens
You might get lucky with characters that have equivalents within the 128-255 range. But a #337 won't work.
Gamecat
That might be it. :-)
Guillem Vicens
Well, somehow it got fixed...I changed a local setting and a lot of things... So it can be fixed.
Aftershock
It uses what Microsoft calls ANSI, i.e. the locale dependent charset.
CodeInChaos
A: 

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.

A.Bouchez