Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode.

Status
Not open for further replies.

Tremorblue

Programmer
Apr 30, 2004
56
GB
Hi,

I have an existing application that uses text files to store the different languages.

I store them using the component object name and property

e.g
[ImageRotation Hint]
ENGLISH=Rotation
FRENCH=Rotation
GERMAN=Drehung

Then use GetPrivateProfileString to load the language that the user needs to use. I got through every visual component on the form loading its caption/hint properties.

Now my customer for a long time wants Russian/Chinese.

I found the components from TMS that allow Unicode characters. When I enter the russian directly into the TNTlabel it displays correctly.

My Question - What format should I convert the language file to ... its text - can be unicode or utf8.

Also how can I load that text into the application ? GetPrivateProfileString uses chars

Thanks

Regards
TB.
 
Which compiler are you using?


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
It runs in my mind that BCBv6 prefers utf8 but i can't find a definitive answer.


James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I had to store the file as UNICODE to get it to work.

Then rewrite my routine for loading from ini files so that it could handle wide strings. e.g

WideString __fastcall TFormDeveloper::GetProfilePieceWide(AnsiString aName,char*sLanguage,char *sFileName)
{
wchar_t sTemp[MAXIMUM_PROFILE_SIZE+1];
GetPrivateProfileStringW((WideString)aName,(WideString)sLanguage,(WideString)"",sTemp,MAXIMUM_PROFILE_SIZE,(WideString)sFileName);
return((WideString)sTemp);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top