Entering names with accents causes problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shadow (Ubuntu) |
Fix Released
|
Medium
|
Colin Watson |
Bug Description
If I have accents in my real name, I'm happy I can enter them when I'm asked
about my real name. I'm even more happy to find those accents in the proposed
username, and I think "cool! Unix got to accept accents for usernames!", and
hit Enter again. At that point, the intallation just asks about my name again.
A good way to generate a good username from the user's name would be to
transcode from the inputted charset to ascii (recode can do that, I hope
something similar is available at base-config time) and then move to small caps
and remove all non-legal characters. Frédéric would become Fre'de'ric and then
frederic. I don't know if some localization libraries offer better transcoding
functions.
Bye,
Enrico
Changed in user-setup: | |
status: | Unconfirmed → Confirmed |
I don't seem to be able to persuade recode to do this, even with -f:
$ echo 'Frédéric' | recode UTF-8..ASCII .ANSI_X3. 4-1968'
Frrecode: Invalid input in step `UTF-8.
$ echo 'Frédéric' | recode -f UTF-8..ASCII
Fric
The best that's available when base-config is invoked is probably iconv. That
performs slightly less badly, but still not well enough:
$ echo 'Frédéric' | iconv -f UTF-8 -t ASCII
Friconv: illegal input sequence at position 2
$ echo 'Frédéric' | iconv -c -f UTF-8 -t ASCII
Frdric
The Perl Text::Iconv module's convert() method just returns undef.
If you know how to persuade any of these tools to do the right thing, I'd be
interested to hear it.