Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages
Started by bar
Sat, 24 May 2008 18:20
WideString to Hexa Decimal Value
Author: bar
Date: Sat, 24 May 2008 18:20
Date: Sat, 24 May 2008 18:20
18 lines
1555 bytes
1555 bytes
Hello, Hope everybody good. I got a situation, where i want to store a arabic text in the registry. If the PC is localized to arabic, it works fine. But if the PC is not localized to arabic, when i assign WideString(Unicode) to registry key it stores as ???. I tried with String, MultiString Keys in the registry. I think the only way is to Convert Unicode WideString to related Hexadecimal numbers and store in the registry and read this value to display the unicode string. Is there any different approach. How to convert WideString to its Hexa Decimal number. Kind Regards SA
Re: WideString to Hexa Decimal Value
Author: Hans Galema
Date: Mon, 26 May 2008 18:21
Date: Mon, 26 May 2008 18:21
23 lines
1419 bytes
1419 bytes
bar wrote:
> I think the only way is to Convert Unicode WideString to related Hexadecimal
> numbers
Convert the WideString to an AnsiString containing the hexadecimal
representaion of individual bytes.
WideString WString = ......
AnsiString HexString;
BYTE *bptr = (BYTE*)WString.c_bstr();
while ( *bptr || *(bptr+1) )
{
HexString += IntToHex ( (int)*bptr, 2 );
bptr++;
bptr++;
}
Label6->Caption = HexString;
Re: WideString to Hexa Decimal Value
Author: Hans Galema
Date: Mon, 26 May 2008 18:34
Date: Mon, 26 May 2008 18:34
11 lines
1195 bytes
1195 bytes
Hans Galema wrote:
Sorry, that should be:
while ( *bptr || *(bptr+1) )
{
HexString += IntToHex ( (int)*bptr, 2 );
bptr++;
HexString += IntToHex ( (int)*bptr, 2 );
bptr++;
}
Re: WideString to Hexa Decimal Value
Author: Remy Lebeau (TeamB)
Date: Tue, 27 May 2008 20:41
Date: Tue, 27 May 2008 20:41
23 lines
1861 bytes
1861 bytes
"bar" <shaikakbar250281@yahoo.co.in> wrote in message news:48385c4f@newsgroups.borland.com... > I got a situation, where i want to store a arabic text in the registry. > If the PC is localized to arabic, it works fine. But if the PC is not > localized to arabic, when i assign WideString(Unicode) to registry > key it stores as ???. I tried with String, MultiString Keys in the > registry. '?' characters appear when a Unicode->Ansi conversion is being performed. The VCL's TRegistry class does not support WideString at all. To store Unicode data, you will have to use the Win32 API RegSetValueExW() and RegQueryValueExW() directly. > I think the only way is to Convert Unicode WideString to related > Hexadecimal numbers and store in the registry and read this value > to display the unicode string. Not true. Gambit
Re: WideString to Hexa Decimal Value
Author: sa
Date: Wed, 28 May 2008 00:27
Date: Wed, 28 May 2008 00:27
2 lines
1009 bytes
1009 bytes
Hello Hans Galema, thanks for reply. i'll try it.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads