Q How to display Unicode strings
A
If the program defines _ Unicode macro, directly use
Wchar * STR = l "unicodestring ";
Textout (0, 0, STR );
Otherwise, the conversion type is required.
# Include
Wchar * STR = l "unicodestring ";
Bstr_t str1 =
UNICODE: Wide-Byte Character Set 1. How to obtain the number of characters in a string that contains both single-byte and double-byte characters?
You can call the Runtime Library of Microsoft Visual C ++ to contain the function _ mbslen to operate
Read and Write Unicode files in the ANSI environment of VC Programming
I did not notice that the differences in file encoding will cause so many problems. I have searched a lot of information before I started, and I have added many of my
1: first, change the project attribute to a multi-byte character set.2: For all l "strings", remove L, or change to => _ T ("string ")PS1: _ t is an automatically replaced macro. It can be replaced with something different based on the Compilation
Q How to display Unicode strings
A
If the program defines _ Unicode macro, directly use
Wchar * STR = l "unicodestring ";
Textout (0, 0, STR );
Otherwise, the conversion type is required.
# Include
Wchar * STR = l "unicodestring ";
Bstr_t str1 =
Summary of Unicode, ANSI character set, and related string operations Q How to display Unicode stringsAIf the program defines _ Unicode macro, directly useWchar * STR = l "unicodestring ";Textout (0, 0, STR );Otherwise, the conversion type is
If you write
Program Users in non-English countries, such as China, Japan, Eastern Europe and the Middle East, must be familiar with Unicode character sets. Especially when you use visual c ++/MFC to write programs for users in the above countries
q Unicode string display A If the Program defines the _ Unicode macro, use it directly BR> wchar * STR = l "unicodestring "; textout (, STR); otherwise, the conversion type # include
wchar * STR = l "unicodestring";
bstr_t str1
I.ANSIAnd Unicode
ANSICharacters andUnicodeCharacterThe ANSI character type is Char, pointing to the string pointer pstr (lpstr), pointing to a constant string pointer pcstr (lpcstr ); the corresponding windows-defined UNICODE character type is
Introduction
If you live in Eastern Europe, Japan or the Middle East, and you write computer programs, you are probably familiar with Unicode. if you are writing programs in Visual C ++/MFC, then you probably have experienced some of the
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.