Hi John,
Thanks for the quick reply.
You don't build a string from bytes, you build it from Unicode
characters (or UTF-16 code points really).
I know I am off slightly with respect to the paradigm.
You want to use System.Text.Encoding.GetString(byte[]) to convert from
bytes to a string.
Thank you very much. I was cruising your site earlier. The example
presented is based on a Stream (but I have a byte array). I was hoping
for a more applicable answer.
I also saw a T.61 string is availble as a CodePage (http://
msdn2.microsoft.com/en-us/library/system.text.encodinginfo.aspx). How
does on set it in C# (or is there an overload in
System.Text.Encoding.GetString() which uses it?).
Thanks Again,
Jeff
On Nov 20, 2:21 pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
Jeffrey Walton <noloa...@gmail.comwrote:
I' working on an ASN.1 parser. The Content Octets (data values) are
stored in a byte[]. The conversion of byte[] to char[] is fairly
trivial. BMP is a special case of UCS, using the lower 65 thousand
characters.
<snip>
How do I specify a character set of UCS (ISO/IEC 10646) when invoking
a string constructor?
You don't build a string from bytes, you build it from Unicode
characters (or UTF-16 code points really).
You want to use System.Text.Encoding.GetString(byte[]) to convert from
bytes to a string.
--
Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
World class .NET training in the UK:http://iterativetraining.co.uk