Arabic characters displaying in Chinese in Delphi 5

I have written an application using Delphi 5. I have a user in Yemen who has been entering patient names into the program for years in Arabic. I have done nothing in my own coding to support this, but apparently it works for him. The characters end up encoded inside the string with characters like chr(227), chr(228), chr(213) etc.  For years, when I display these names on the screen, they appear in Arabic, just as he wishes.
Suddenly, in just one place in the software (a TStringGrid), when I display the name, it now appears using Chinese letters instead of Arabic letters. Again, I did nothing to command Delphi to do this. I have no idea why this is happening. I can reproduce the problem on my own computer (Windows 7 using its default settings, not changing the control panel region and language to anything else). The font of the TStringGrid is 'System' with CharSet of 1 (the default), point size of 10; the other location is a TEdit with the same Font ('System'), CharSet of 1, point Size of 10. I can't see anything that I changed inside my own code involving this step which would change the way it displays text. The problem also occurs on his computers which are running Windows XP.

I discovered that if I change the charset of the TStringGrid to 178 (ARABIC_CHARSET) I can force Delphi to display the names in a script form of Arabic, but it does look different from the printed form of Arabic which appears in the TEdit.

In any case, I am not telling Delphi to use Unicode or any other fancy thing, and I simply have no idea why it would suddenly decide to display in Chinese rather than Arabic. Does anyone know why, or any other way around this issue?

This does not involve using the Internet at all; it simply runs on a computer.
OnionsingerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sinisa VukSoftware architectCommented:
Try:
- set Charset back to DEFAULT_CHARSET
- set same font as in TEdit
- set ParentFont to False

Is all texts in TstringGrind incorrect?
From where and how you get texts for StringGrid?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OnionsingerAuthor Commented:
I solved this even before reading the above comment, but I give the author credit.
DEFAULT_CHARSET is the same as a value of 1 (see Delphi help under TCharSet)
I had searched my code in vain for a location where I had changed the font or charset, and found no place where I had done so.
However, I had overlooked the fact that the charset can also be set in the Object Inspector. This is what caused the problem. I apparently had accidentally pressed a key while the charset line was the highlighted line, causing it to change to HANGEUL_CHARSET, which is actually the Korean alphabet. Neither the user nor myself can read Chinese nor Korean, so we mistook the Korean letters for Chinese letters. In any case, changing the charset back to DEFAULT_CHARSET in the Object Inspector solved the problem. The program that displays Arabic characters if that is how the user has set up Windows as the default language, rather than forcing the characters to be Korean.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.