convert an hexadecimal value to utf-8 encoding
-
Hello to all, how can i convert an hexadecimal value to utf-8 encoding example : 012b must returns in utf-8 i 0160 must returns in utf-8 Š best regards and thanks in advance Fady
-
Hello to all, how can i convert an hexadecimal value to utf-8 encoding example : 012b must returns in utf-8 i 0160 must returns in utf-8 Š best regards and thanks in advance Fady
Hi, have a look at the Encoding class, in particular UTF8 property and GetChars/GetString methods. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy 2008!
-
Hello to all, how can i convert an hexadecimal value to utf-8 encoding example : 012b must returns in utf-8 i 0160 must returns in utf-8 Š best regards and thanks in advance Fady
string hex; hex = "012b"; hex = "0160"; int hexAsInteger = int.Parse(hex, System.Globalization.NumberStyles.HexNumber); char charValue = (char)hexAsInteger; MessageBox.Show(charValue.ToString());
Jim
-
string hex; hex = "012b"; hex = "0160"; int hexAsInteger = int.Parse(hex, System.Globalization.NumberStyles.HexNumber); char charValue = (char)hexAsInteger; MessageBox.Show(charValue.ToString());
Jim
thanks a lot Luc Pattyn and Jim Fady
-
thanks a lot Luc Pattyn and Jim Fady
try this UInt16Converter utf8 = new UInt16Converter(); char MyChar = '\x012b'; MessageBox.Show(utf8.ConvertToString(MyChar));
dghdfghdfghdfghdgh
-
try this UInt16Converter utf8 = new UInt16Converter(); char MyChar = '\x012b'; MessageBox.Show(utf8.ConvertToString(MyChar));
dghdfghdfghdfghdgh
or try this char MyChar = '\x012b'; MessageBox.Show(MyChar.ToString());
dghdfghdfghdfghdgh
-
try this UInt16Converter utf8 = new UInt16Converter(); char MyChar = '\x012b'; MessageBox.Show(utf8.ConvertToString(MyChar));
dghdfghdfghdfghdgh
I was unaware of class UInt16Converter. However the MSDN doc says "You should never create an instance of a UInt16Converter. Instead, call the GetConverter method of TypeDescriptor." So you may want to modify your code snippet. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!
-
I was unaware of class UInt16Converter. However the MSDN doc says "You should never create an instance of a UInt16Converter. Instead, call the GetConverter method of TypeDescriptor." So you may want to modify your code snippet. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!
hehe see the last reply
dghdfghdfghdfghdgh