C #, Textbox.Text encoding

I have a code:

string text = sampleTextBox.Text;

and I wonder what code is the text in? Is it utf16 (like a string) or maybe it's my operating system?

+3
source share
2 answers

All Unicode, in principle - there is no conversion between .NET text types ( char/ string) and binary, so there is no encoding to worry about.

You may need to worry about surrogate pairs to obtain from a text representation of UTF-16 charand stringto the full UTF-32, but a little different from the usual problems with the encoding.

, , . , - , .

+9

.Net UTF-16. , : , - .

+3

Source: https://habr.com/ru/post/1758370/


All Articles