.NET Convert from string of Hex values into Unicode characters (Support different code pages)
I have a string of Hex values... String hexString = "8A65"; I need to convert this string into their Unicode equivalents. The tricky part is that I need to support different code pages and some code pages have '8A65' = one character whereas other code pages would convert it into two characters. I have no prior knowledge of which code page I will be using until I need to perform the conversion. I've tried all sorts of stuff such as byte[] original = Encoding.Unicode.GetBytes(hexString); byte[] conv= Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(932), orig); char[] chars = Encoding