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!

Delphi 2009 vs. C++ Builder 2009: UnicodeString 1

Status
Not open for further replies.

BoMi

Programmer
Jul 20, 2006
39
RS
Hi!

Me again :)

Consider this piece of code:
Code:
   s: UnicodeString;
   
   s := '?? ?? ?? ?? ?? ?? ?? ????????????????????';

   Memo1.Lines.Add(s);

and the same lines in C++ Builder:
Code:
   UnicodeString s;
   
   s = "?? ?? ?? ?? ?? ?? ?? ????????????????????";

   Memo1->Lines->Add(s);

Now, during runtime, Delphi correctly displays that unicode string (which is Serbian Cyrillic), but C++ Builder not.

C++ Builder gives this warning, e.g.:

Code:
[BCC32 Warning] Unit1.cpp(19): W8114 Character represented by universal-character-name '\u0409' cannot be represented in the current code page (1250)
For other caracters too.

I'm not up to the speed to code page changing, I tried some stuff and it didn't work. Might figure it out later.

What I would like to know is: why in delphi that code works flawleslly and for C++ Builder to work I have to do some code page setting or whatever?
It should be the same principle.

Any ideas?

Best regards...
 
Thanks DjangMan!

As a matter of fact I've already read that paper by Marco Cantu. I'm in the process of trying some stuff he mentioned. No luck so far.
The second link is ok, but not helpfull.

Anyway, I did a workaround of some sorts. I save all the text I'm using in my program to the unicode .txt file, put it in application's resource file and load it at the start of the application into the TStringList. Then those strings put where needed. That way it works flawleslly.

But... I'm still irritated it's not working straighforward (as shown in the first post) as it should.

Best regards...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top