Sergey Slepov
Sergey Slepov

Reputation: 2121

How to get the Unicode script for a character in .NET?

Is there a way to get the Unicode script (writing system) for a char in C#?

CharUnicodeInfo does not seem to provide this.

Upvotes: 1

Views: 178

Answers (1)

xanatos
xanatos

Reputation: 111940

Not with "plain" .NET... Even in .NET 5.0 the information contained in UnicodeRanges is incomplete: only BMP characters (so characters that only need a single char) are described... With libraries like UnicodeInfomation you can obtain the information you want. That library for example exposes the Block. Note that some alphabets (Latin for example) have various separate blocks assigned to them.

And see this: Finding out Unicode character name in .Net If a library can give you the character name, surely it can give you its block.

Upvotes: 2

Related Questions