Unicode question
C#
2
Posts
2
Posters
0
Views
1
Watching
-
I want to do a edit usercontrol that like VC++. It can auto check user input text's length. But don't like c#,For example, "全角", it's lenthe is 4, isn't 2. How to do it?
Multiply the string's length value by 2. However, this is NOT indicitave of the amount of memory used by the string (length prefix etc). To get a C++ representation of what the unicode string, you will probably want to convert the string to an array of short and manipulate it like that. Use the System.Text.Encoding namespace to convert the string to and from a short array.