Document string handling and encoding format issues in C + + and C #

Source: Internet
Author: User

The following is the basics of character, Byte, and encoding format:

Http://www.regexlab.com/zh/encoding.htm


The program involves several conversions of the encoded format:

1. Code text, string is saved according to the encoding method set by our text

2. During code execution, the string is stored in memory in an encoded way

3. If the code produces a string output, the output to the problem string different IO classes will produce different encoding methods of saving, of course, this can be set to implement the change


Because the same string has a 3-time encoding format switch, the actual bytes stored in the 3 places here may not be the same length.

In addition, if the string is byte-stream processing, to be extra careful, do not confirm the specific encoding method (Kanji: Unicode encoding 2 bytes, UTF8 encoded 3 bytes,ANSI code to see the specific localization code ).

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. Bo Master Contact: [email protected].

Document string handling and encoding format issues in C + + and C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.