0

I'm having this problem with (I assume) Windows. I need to convert an existing application written in Delphi 7 in a multilingual application. I'm using the Delphi ITE and everything works well, except, when the file is saved and recompiled, special characters like ë is converted to e.

I thought that this is a Delphi issue but then realized that, even if I create text document in notepad, insert the character ë, save the document in ANSI format, and then open it again, the character is converted to e.

Is there any workaround to this, except for upgrading to Delphi 2009 and using unicode components? How can I make Windows keep the original character?

Obviously this is not a coding issue, so no relevant code could be posted.

Thanks

Kiro Coneski
  • 515
  • 1
  • 5
  • 20
  • Since this is happening in Notepad as well, let's focus on the operating system rather Delphi. What version of Windows are you using, and specifically which language version? I just opened Notepad and entered the phrase "like ë is converted to e.", saved it in ANSI format, opened it again, and it was fine. I did this on several versions from XP to 8.1. – David Dubois Mar 06 '14 at 15:06
  • It's Windows 8. And I'm writing the character with Albanian keyboard (SQI) and, also, by typing the combination Alt + 0235. Both ways don't work. – Kiro Coneski Mar 06 '14 at 15:12
  • If you wanted to ask what language is my Windows on by "which language version" it is English – Kiro Coneski Mar 06 '14 at 15:14
  • My hypothesis was that the specific character "ë" is not supported by your Windows version default code page. If you are using English (or Albanian), then that shouldn't be the issue. In your post, you said characters _like_ "ë". Does that character specifically fail? Or are you having trouble with other characters that are _like_ that character. – David Dubois Mar 06 '14 at 15:18
  • "ANSI" is one of those unfortunate terms. In practice, it means "your Windows application is going to have interesting bugs in multi-lingual environments". In theory, it means that Windows will convert between 8 bits characters and 16 bits characters, using a codepage which can't be UTF-8 and cannot cover all Unicode characters. – MSalters Mar 06 '14 at 15:18
  • @user1008646 yes it is specifically ë. But, I have to say sorry here :) The default locale language was in fact Macedonian. I changed it to Albanian, and now in the Notepad, it works fine. But in Delphi ITE, the same problem persists. – Kiro Coneski Mar 06 '14 at 15:28
  • 1
    You need to switch to a Unicode Delphi, or use `WideString` and TNT Unicode. You won't have any success until you start using Unicode. – David Heffernan Mar 06 '14 at 15:29
  • Furthermore, when I'm translating form files it fails. When I translate resource files, It works great – Kiro Coneski Mar 06 '14 at 15:29
  • Let me review. Your Windows language was Macedonian, which uses code page 1251 which does not support ë. You switched the machine to Albanian, which uses code page 1250, which does have that character. Now you run Notepad and you can save a file in ANSI mode with that character. But now (after rebooting the machine, I assume), you open a new file in the Delphi IDE, type in ë, save the file, close Delphi, reopen Delphi, load the file, and you see "e" on the screen. Is this correct? Or are you opening old files that have already had the "e" stored. – David Dubois Mar 06 '14 at 15:56
  • Yes... language is still Albanian, and no matter when was the file created (with what code page) plain simple 'e' is displayed... but, I'm talking about the Translation editor that is part of the Delphi ITE (Integrated Translation Environment), and even here, some file types are stored correctly. Only when I translate form components I lose the character – Kiro Coneski Mar 06 '14 at 17:34
  • @Kiro Why are you ignoring Unicode? How do you expect to succeed with Unicode? – David Heffernan Mar 06 '14 at 21:46
  • I'm not ignoring unicode :) The problem is that the project is huge, it uses tons of third party components that are not Unicode. Switching them to Tnt components would be painfull, as will be migrating to newer Delphi versions. – Kiro Coneski Mar 07 '14 at 08:51

0 Answers0