Skip to content

Using a three byte Emoji unicode character as a PasswordChar in a text box crashes the app. #17554

Answered by maxkatz6
LaurentInSeattle asked this question in Q&A
Discussion options

You must be logged in to vote

'🏍' is not really a character, instead it's a pair of two characters, and could be more.

Since .NET doesn't allow setting such emoji as a char, we won't be able to support them. Unless we change API to use string instead. I.e. string PasswordMask or something.

> '🏍'
< (1,19): error CS1012: Too many characters in character literal

> "🏍".ToCharArray()
< char[2] { '\ud83c', '\udfcd' }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LaurentInSeattle
Comment options

Answer selected by LaurentInSeattle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants