Re: The weirdness of capitalizing usernames (was Re: Yet another attempt to specify GECOS) Lassi Kortela 27 Aug 2019 16:20 UTC
> OK; I was going from what you'd recently added to the SRFI. Is "first > letter capitalized" sufficient in the context of Unicode strings?? If > per SRFI 129 the first character is a titlecase character, what exactly > should be done? I recommend checking only for ASCII a-z and capitalizing only those. The thoroughness of SRFI 129 is impressive but Unix usernames rarely if ever contain Unicode and the canonical GECOS parsers don't grok Unicode. > Taking a step back, given the common in the 1970s and probably 1960s > method of making a username out of your initials, which I followed to > create "hga", capitalizing that type of username makes absolutely no > sense, e.g. "Rms", or for the co-inventors of Scheme, "Gjs" and "Gls". > I wonder where and why this particular bit of ornamentation came from, If there are no ampersands in your realname, no part of it is replaced or capitalized - it stays exactly as you wrote it. Ampersands are meant for cases where people use their first or last name as the username (which has been quite common for decades as well). It may have come from the original BSD but don't quote me... Finger and sendmail seem to be the most notable programs that do the expansion, and they hail from the same early-internet-unix scene. > especially since POSIX usernames are allowed to be case sensitive > (although I wouldn't try that in a world getting eaten by systemd): > > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_431 > >> A string that is used to identify a user; see alsoUser Database >> <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_435>. >> To be portable across systems conforming to POSIX.1-2017, the value is >> composed of characters from the portable filename character set. The >> <hyphen-minus> character should not be used as the first character of >> a portable user name. > > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 > >> >> 3.282Portable Filename Character Set >> >> The set of characters from which portable filenames are constructed. >> >> A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i >> j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ - Thanks for digging that up, that is impressive diligence once again :) On some not-too-old Unix systems it used to be that if you write your username in all uppercase at the login prompt, it assumes that you're using a keyboard that cannot enter lowercase characters :D And did some things to accommodate your circumstances, like translating to lowercase. Can't remember the details.