![]() UTF-8 is often identical in the U+00 to U+7F range, but can encode characters outside the ASCII range without loss. Because all Default encodings based on ANSI code pages lose data, consider using the Encoding.UTF8 encoding instead. The active code page may be an ANSI code page, which includes the ASCII character set along with additional characters that vary by code page. NET Framework on the Windows desktop, the Default property always gets the system's active code page and creates a Encoding object that corresponds to it. You could also use a higher-level protocol to ensure that the same format is used for encoding and decoding. To ensure that encoded bytes are decoded properly, you should use a Unicode encoding, such as UTF8Encoding or UnicodeEncoding. For these reasons, using the default encoding is not recommended. In addition, the encoding returned by the Default property uses best-fit fallback to map unsupported characters to characters supported by the code page. ![]() If you use the Default encoding to encode and decode data streamed between computers or retrieved at different times on the same computer, it may translate that data incorrectly. Different computers can use different encodings as the default, and the default encoding can change on a single computer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |