Your Ad Here
Showing posts with label Encoding and Decoding. Show all posts
Showing posts with label Encoding and Decoding. Show all posts

Friday, 6 January 2012

Encoding and Decoding in .NET Framework

Friends i am B.TECH Engineer(I.T) . Hopefully these notes may help u.

Encoding and Decoding
American Standard Code for Information Interchange (ASCII) is still the foundation for existing encoding types. ASCII assigned characters to 7-bit bytes using the numbers 0 through 127.

More and more, ASCII and ISO 8859 encoding types are being replaced by Unicode. Unicode is a massive code page with tens of thousands of characters that support most languages and scripts, including Latin, Greek, Cyrillic, Hebrew, Arabic, Chinese, and Japanese (and many other scripts).
Unicode itself does not specify an encoding type; however, there are several standards for encoding Unicode. The .NET Framework uses Unicode UTF-16 (Unicode Transformation Format, 16-bit encoding form) to represent characters. In some cases, the .NET Framework uses UTF-8 internally. The System.Text namespace provides classes that allow you to encode and decode characters. System.Text encoding support includes the following encodings:

Unicode UTF-32 encoding Unicode UTF-32 encoding represents Unicode characters as sequences of 32-bit integers. You can use the UTF32Encoding class to convert characters to and from UTF-32 encoding.

Unicode UTF-16 encoding Unicode UTF-16 encoding represents Unicode characters as sequences of 16-bit integers. You can use the UnicodeEncoding class to convert characters to and from UTF-16 encoding.

Unicode UTF-8 encoding Unicode UTF-8 uses 8-bit, 16-bit, 24-bit, and up to 48-bit encoding. Values 0 through 127 use 8-bit encoding and exactly match ASCII values, providing some degree of interoperability. Values from 128 through 2047 use 16-bit encoding and provide support for Latin, Greek, Cyrillic, Hebrew, and Arabic alphabets. Values 2048 through 65535 use 24-bit encoding for Chinese, Japanese, Korean, and other languages that require large numbers of values. You can use the UTF8Encoding class to convert characters to and from UTF-8 encoding.