Link to home
Start Free TrialLog in
Avatar of Probie
ProbieFlag for Sweden

asked on

Adding "Far-East Characters" support in an existing project/application

I have a project that now needs to support Japanse language & characters. As far as I know, Delphi5 VCL TEdit and other controls in my existing project doesn't support Unicode, so it will not be possible to enter characters into these controls.

Can anyone enlight me what to do with all this?

Do I need to replace all controls in my project with Unicode controls and replace all string types with WideStrings? Will that do or is it more?

How does japanese developers do? is there a special version of Delphi that supports UniCode?

Can my project be recompiled on a japanese Delphi5 if so?

Is there a way to enable input of unicode in a TEdit control during runtime with Win API by setting/sending any value to the EditBox window handle?

Avatar of Alone
Alone

Try to download NT Unicode Controls from http://home.ccci.org/wolbrink/tntmpd/delphi_unicode_controls_project.htm

WBR...
And, as I know, there is no special, Unicode version of Delphi. This is a BIG problem not for Japanese developers only...
To support japanese in a Delphi application it does not necessarily need Unicode - Unicode would only make it much easier to implement. There is a 8bit charset used for japanese Windows in Win3.1 already, the only difficulty is that it is a MBCS (Multi byte character set), thus the easy string operations don't work on it. But if you set all the input and output controls to that charset (SHIFTJIS_CHARSET), and use the WideCharToMultiByte(CP_ACP,...) API call to convert your Unicode to that charset, and vice versa, you can create an application which does show japanese in the interface but internally uses Unicode.

The alternative is to convert the application from VCL to CLX, for those the Qt layer does all the Unicode handling, even on Windows versions which don't support Unicode.
Avatar of Probie

ASKER

Well, I can't get your "SHIFTJIS_CHARSET" to work.

Can you give an example?
It's at the font property:

edit1.font.charset:=SHIFTJIS_CHARSET;

or select that value in the object inspector. Unless you use different fonts for the controls it's enough to set just the form1.font.charset.
Avatar of Probie

ASKER

Well, I have no problem with setting the charset...
I have been working with Delphi for 5 years now so I know such stuff.. hehe...

Setting the charset doesn't make it possible to input japanese characters into the Edit box...

The problem is far bigger then just setting a character set..


ASKER CERTIFIED SOLUTION
Avatar of andyho
andyho

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Probie

ASKER

Well, I have to reject your proposed answer then.

I need to know the best way to make it possible to enter japanese characters into any windows system that supports japanese characters.. (ex US version of Win2000 with Japanase supprt installed)

There is no problem in input japanese characters into a RichEdit, but that is because RichEdit supports Unicode.

I need a way to make TEdit to support Unicode...