Is there a way to use supplemental Unicode characters (for example '🃜') as char literals in C#? I tried it in VS 2017, with the source file saved as UTF-8 with BOM, UTF-16 LE and BE and I always get the error Too many characters in character literal.
No, char is one UTF-16 code unit. String is a sequence of UTF-16 code units so if you have a codepoint that UTF-16 encodes as two code units, use a String literal.
"🃜"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With