1
votes

i recently asked (and paid) for translation of my Delphi app to support Macedonian (Cyrillic font) support. I posted text to translate to my contracted translator, she sent me back translated strings. The text was extracted from all my .dfm and .pas files

when i replaced the original text with cyrillic translation, i can open .dfm fies also .pas files in my favourite Notepad++ (or notepad) , and i see translated characters correctly.

When i open these files in Delphi (as dpr file) , i see something like this:

enter image description here

Please someone tell me how to convert/display these strings in Delphi correctly. I am using Macedonian regional settings, but it not helped me with this problem.

PS: Yes I am still using Delphi 7 because i love it / purchased this version.

UPDATE

Original text in Delphi: original: ПОДГОТВИ КУТИИ ЗРДРУГИТЕ ЦЕÐТРÐЛИ

Correct text: ПОДГОТВИ КУТИИ ЗА ДРУГИТЕ ЦЕНТРАЛИ

I noticed, when i change ParentFont property to false and font set to Verdana and Cyrillic (RUSSIAN_CHARSET) , then i copy/paste cyrillic text, it shows normally in Delphi

2
The repeated character suggests the strings are in some form of Unicode but are being displayed as 8 bit ASCII with a code page in Delphi. It would he helpful if you posted an actual string or two as text and as a series of hex values so those looking to answer can figure out the encoding used. - Brian
We don't have code. We don't know what fonts you have installed. We don't know whether you use tnt Unicode library. We cannot understand why you would attempt international code in an tool that can't do it natively. - David Heffernan
@DavidHeffernan what code you want? Source code is not important, i replaced EN text with Cyrillic text, nothing else.. I mean in all caption values of .dfm file. I am not using tnt unicode library - FeHora
You need to enter the macedonian in the proper relevant encoding, and make sure that the clients run their windows with their locale set to macedonian/cyrillic. There is no unicode support in D7, so it is all about making the "A" encoding match. - Marco van de Voort
The right tools. Either Unicode Delphi or TNT Unicode components with Delphi 7. This is the help you need, although you can't see it. Personally, when I did this with my code I took the first option. - David Heffernan

2 Answers

1
votes

OK so i SOLVED that!

The solution is multi step one, and Notepad++ is needed:

1st step: Replace all fonts in .dfm with (for example) Verdana , or some font that allows Cyrillic support

2nd step: Replace all ParentFont = False to ParentFont = True

3rd step: In notepad++ Choose: Encoding -> Convert to ANSI

that's all, do this for all .dfm and .pas file (only 3rd step)

i am happy to not Listened David Heffernan and not gave up!

0
votes

Your text file was UTF-8 encoded, whereas Delphi7 requires WinAnsi encoding, with codepage 1251 for Cyrillic characters.

You have the UTF8Decode() function in System.pas to make the conversion programmatically, if you prefer.