Character code for string in other language
-
Hi to all, Someone helped me on other forum to convert a string in any language to it's bytes format, using following code. string s = "François"; byte[] unicodeBytes = Encoding.Unicode.GetBytes(s); byte[] aBytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(28599), unicodeBytes); He told me to use WideCharToMultiByte() in C++ for above C# code. He help me a lot. But I want to know that, is there any method to get the character code for given value in string s to convert that string in bytes? Is there any software or dlls to release the application with some evalution period? Regards, Aniket A. Salunkhe
-
Hi to all, Someone helped me on other forum to convert a string in any language to it's bytes format, using following code. string s = "François"; byte[] unicodeBytes = Encoding.Unicode.GetBytes(s); byte[] aBytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(28599), unicodeBytes); He told me to use WideCharToMultiByte() in C++ for above C# code. He help me a lot. But I want to know that, is there any method to get the character code for given value in string s to convert that string in bytes? Is there any software or dlls to release the application with some evalution period? Regards, Aniket A. Salunkhe
You can typecast each character using wchar_t to get the unicode value or using char to get the ascii value.
int i = wchar_t(s[0]);
int j = char(s[0]);«_Superman_»
-
You can typecast each character using wchar_t to get the unicode value or using char to get the ascii value.
int i = wchar_t(s[0]);
int j = char(s[0]);«_Superman_»
I am getting wrong output when I have string in Arabic Language. I want to convert a string (in any langauge) to bytes format as geiven in Annex A of ETSI EN 300 468 V1.9.1 (2008-11) Digital Video Broadcasting (DVB) : Specification for Service Information (SI) in DVB systems For that someone has suggested to use System.Text.Encoding. But to use that, I must know the codepage before compilation. So is there any method to retrieve codepage?
-
I am getting wrong output when I have string in Arabic Language. I want to convert a string (in any langauge) to bytes format as geiven in Annex A of ETSI EN 300 468 V1.9.1 (2008-11) Digital Video Broadcasting (DVB) : Specification for Service Information (SI) in DVB systems For that someone has suggested to use System.Text.Encoding. But to use that, I must know the codepage before compilation. So is there any method to retrieve codepage?
Aniket Salunkhe wrote:
So is there any method to retrieve codepage?
You can get code page information using APIs like
GetACP
,GetCPInfo
etc.«_Superman_»
-
Aniket Salunkhe wrote:
So is there any method to retrieve codepage?
You can get code page information using APIs like
GetACP
,GetCPInfo
etc.«_Superman_»