How are 4 bytes chars are represented in C#? Like one char or a set of 2 chars?
var someCharacter = 'x'; //put 4 bytes UTF-16 character
How are 4 bytes chars are represented in C#? Like one char or a set of 2 chars?
var someCharacter = 'x'; //put 4 bytes UTF-16 character
C# can only store characters from the Basic Multilingual Plane in the char
type. For characters outside this plane two char
s must be used - called surrogates.
You can also use a string literal such as:
string s = "\U0001D11E";
See UTF-16.
© 2022 - 2024 — McMap. All rights reserved.