0
votes

In non-unicode Delphi (I've tried with D7 and D2006):

  1. Put a TRichEdit on the form and run the application
  2. Switch to some "exotic" keyboard layout (Russian, Greek, whatever)
  3. Type something

On XP, everything is good and I can see normal Russian letters. However, on Win7 characters are wrong (accented letters from other languages). If I copy Russian text from MS Word and paste it to RichEdit, it looks OK.

I suspect it is something related to RichEdit control version, but it there any way to overcome it? If possible, I would like to avoid switching to TTntRichEdit (which appears to work correctly), as I would need to change lots of existing code.

1
Seems to work fine with D5 on my Win7 x64. Though, if you switch keyboards while the program is running, the application doesn't detect it. - Marcus Adams
This may not be relevant but have you seen this Francois post about using different version blogpost - Merlin W.
Thanks Merlin, no I haven't saw that one. I'll try to follow it. - vrad
You want to use a non-unicode control in a unicode windows version, and use MBCS with Russian? What's your code page? You ARE AWARE that the TRichEdit control on Delphi 7 is an MBCS version, not a UNICODE version, and that this is the most likely cause of your confusion and your problems. CodePages matter deeply in MBCS/AnsiString Delphi. - Warren P

1 Answers

0
votes

Try to use converions like AnsiToUtf8 or AnsiToUnicode, when user presses a key.