What happens if we have a chinese character in .NET that doesn't fit in a UTF-16

T

Tony

Hello!

These non-english character fits within UTF-16 that is used for a char in
..NET
char c1 = 'é';
char c2 = 'å–‚';
char c3 = 'è°¢';

I just wonder if it exist character that doesn't fit within the border of
UTF-16 encoding ?
If there is how is that solved when a char is using only 16 bits.

//Tony
 
A

Arne Vajhøj

These non-english character fits within UTF-16 that is used for a char
in .NET
char c1 = 'é';
char c2 = 'å–‚';
char c3 = 'è°¢';

I just wonder if it exist character that doesn't fit within the border
of UTF-16 encoding ?
If there is how is that solved when a char is using only 16 bits.

There are Unicode values greater than 65535.

In that case two chars is used.

Read http://msdn.microsoft.com/en-us/library/system.string.aspx
the section "Char Objects and Unicode Characters".

Arne
 
Top