23

TLDR: The alphabetic check is erroneously checking UTF-16 code units not Unicode code points!

I attempted to change my username to the Gothic version, and I received the rather rudely rubicund retort of:

Error message on username

Now, the string in question was 𐌸𐍇𐍂𐌹𐍃𐍄, which as you can plainly see, is entirely composed of letters in the Gothic alphabet. In particular, those are:

  • "\N{GOTHIC LETTER THIUTH}\N{GOTHIC LETTER IGGWS}\N{GOTHIC LETTER RAIDA}\N{GOTHIC LETTER EIS}\N{GOTHIC LETTER SAUIL}\N{GOTHIC LETTER TEIWS}"

Now, lest there be any doubt that those are all valid letters, notice:

$ perl -Mutf8 -le 'print "𐌸𐍇𐍂𐌹𐍃𐍄" =~ /^\p{Letter}+$/ ? 1 : 0'
1

$ perl -Mutf8 -le 'print "𐌸𐍇𐍂𐌹𐍃𐍄" =~ /^\w+$/ ? 1 : 0'
1

Which looked like this to me:

pic of xterm

What’s almost certainly happening is that the verification code doesn’t actually deal with Unicode characters at all, which is highly disappointing. You see, that purely alphabetic string contains letters whose code points exceed 0xFFFF, and thus occupy two UTF-16 code units instead of one. The string in question is this one using hex escapes:

  • "\x{10338}\x{10347}\x{10342}\x{10339}\x{10343}\x{10344}"

You can see how those are over 0xFFFF.

But that doesn’t matter, because they are legal alphabetic code points, and are even displayed correctly:

picture of edit page

Please stop discriminating against valid Unicode letters and telling me I didn’t use letters when I did! 😢

3
  • 8
    I can't plainly see anything, all those letters are just empty boxes for me. What is wrong with tchrist as a username? I assume you had to install some custom font to use them at all? From the screenshots it looks like you and I are running the same operating system, and I only have default system fonts. May 19, 2014 at 5:35
  • 3
    @AbhiBeckert It doesn’t really matter what one’s username is: the rules state that you can use (amongst other things) letters, and there is a bug in the code that prevents that. The point is being missed here that there is a bug in the code: when letters are supplied, it says you did not do so. That’s a bug. The Unicode is being handled incorrectly.
    – tchrist
    May 19, 2014 at 5:38
  • 3
    @AbhiBeckert, If you copy the name into font.ubuntu.com you'll see it handled correctly. I think the Ubuntu font has pretty good alphabet coverage.
    – TRiG
    May 20, 2014 at 18:20

0

You must log in to answer this question.

Browse other questions tagged .