> 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.

Signature
Jon Skeet - <skeet@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
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
> > 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
[quoted text clipped - 15 lines]
> 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
Jon Skeet [C# MVP] - 20 Nov 2007 20:28 GMT
> > You don't build a string from bytes, you build it from Unicode
> > characters (or UTF-16 code points really).
[quoted text clipped - 5 lines]
> presented is based on a Stream (but I have a byte array). I was hoping
> for a more applicable answer.
Okay, to load a string from a Stream, you use a StreamReader with a
suitable Encoding.
> 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?).
You can supply a code page to Encoding.GetEncoding.

Signature
Jon Skeet - <skeet@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