Skip to Content
.NET Common Language Runtime Unleashed
book

.NET Common Language Runtime Unleashed

by Kevin Burton
April 2002
Intermediate to advanced content levelIntermediate to advanced
1024 pages
23h 26m
English
Sams
Content preview from .NET Common Language Runtime Unleashed

System.Text

The System.Text namespace contains classes that deal with converting from one character encoding to another. The input is assumed primarily to be Unicode. The output varies with the encoding class that is selected. Listing B.59 shows an example of using the UTF8 encoding class (encoding.cs).

Listing B.59. Using UTF8 Encoding
 byte [] encoded; UTF8Encoding encoding = new UTF8Encoding(); Console.WriteLine("CodePage: {0} ", encoding.CodePage); Console.WriteLine("EncodingName: {0} ", encoding.EncodingName); Console.WriteLine("WindowsCodePage: {0} ", encoding.WindowsCodePage); encoded = encoding.GetBytes(japanese); Console.WriteLine("Encoded Japanese: {0} <-> {1} ", japanese.Length, encoded.Length); encoded = encoding.GetBytes(chinese); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Customizing the Microsoft® .NET Framework Common Language Runtime

Customizing the Microsoft® .NET Framework Common Language Runtime

Steven Pratschner

Publisher Resources

ISBN: 0672321246Purchase book