In article <449592@forums.embarcadero.com>, DennisP@nospam.dpassmore.com
says...
>
> What I think the person is asking is how to convert the existing (2009 plus)
> Unicodestring back into a AnsiString for storage back into a BDE\Paradox
> database and of course when reading the AnsiString out of the Paradox
> database and converting it back into UnicodeString for internal usage
> in thier program.
That is correct. I have just started my first XE2 project and has been
introduced to Unicode. I tried to find some string conversion API:s but
haven't found a "simple" ANSI<->UNICODE function. Can anyone point me in
the right direction?
Regards
Goran
Hi Lajos
> In D2009+ you don't need API functions to convert a string from and to
> unicode. The ansistring is now code page aware and whenever you assign
> it to string variable the compiler will do the conversion for you.
I assume you are talking about string constants since you are refering to
"compiler conversion". This is what I would like to do:
AnsiString Test = "fdsfsd";
UnicodeString Test2 = Test;
This would have been the sweetest thing, a simple assignment conversion that
is code page aware but the compiler complains so there is no built-in
support for this in the UnicodeString class.
> MultiByteToWideChar and WideCharToMultiByte.
Is this the "solution"?
Regards
Goran
> > when converting a project into Unicode, how should you handle string
> > fields in Paradox DB:s? Yes, I know, BDE is deprecated...
> As Ansi.
OK, do I need my own "converter" UnicodeString<->AnsiString or do the classes include it so you can just to assign them to each other freely?
Thanks,
Goran