Manipulating both unicode and ASCII character set in C#
Posted
by
Murlex
on Stack Overflow
See other posts from Stack Overflow
or by Murlex
Published on 2011-01-05T08:24:47Z
Indexed on
2011/01/05
8:53 UTC
Read the original article
Hit count: 186
I have this mapping in my C# application
string [,] unicode2Ascii = {
{ "ஹ", "\x86" }
};
ஹ - is the unicode value for a tamil literal "ஹ". This is the raw hex literal for the unicode value saved by MS Word as a byte sequence. I am trying to map these unicode value "strings" to a hex value under 255 (so as to accommodate non-unicode supported systems).
I trying to use string.replace like this:
S = S.replace(unicode2Ascii[0,0], unicode2Ascii[0,1]);
However the resultant ouput has a ? instead of the actual hex 0x86 stored. Any pointer on how I could set the encoding for the second element of that array to something like windows-1252?
Or is there a better way to do this conversion?
thanks in advance
© Stack Overflow or respective owner