Mega Search
23.2 Million


Sign Up

Make a donation  
BDE and Unicode  
News Group: embarcadero.public.bde.general

Hi,
when converting a project into Unicode, how should you handle string 
fields in Paradox DB:s? Yes, I know, BDE is deprecated...

Regards
Goran

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 25-Feb-2012, at 6:26 AM EST
From: Goran Ekstrom
 
Re: BDE and Unicode  
News Group: embarcadero.public.bde.general
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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 13-Mar-2012, at 2:50 AM EST
From: Goran Ekstrom
 
Re: BDE and Unicode  
News Group: embarcadero.public.bde.general
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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Mar-2012, at 2:01 AM EST
From: Goran Ekstrom
 
Re: BDE and Unicode  
News Group: embarcadero.public.bde.general
> > 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

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Feb-2012, at 5:08 AM EST
From: Goran Ekstrom
 
Re: BDE and Unicode  
News Group: embarcadero.public.bde.general
OK, thanks!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Feb-2012, at 4:37 AM EST
From: Goran Ekstrom
 
Re: BDE and Unicode  
News Group: embarcadero.public.bde.general
Many thanks!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 17-Mar-2012, at 12:01 AM EST
From: Goran Ekstrom