Long utf-8 characters

Ray Strode halfline at gmail.com
Tue Jul 14 13:52:31 PDT 2009


Hey Charlie,

> Passwords with long characters are failing because the multi-byte character
> functions rely on the locale. So I tried setting the locale but then that
> fails because libc wants to have /usr/lib mounted to read the locale info
> and that's difficult when typing the password to decrypt / . The file it
> wants is 80Mb so too large to have in the initrd.
Ugh.  Right make sense.

> The only way I can see of getting through this is to use our own utf-8 char
> and string length functions. Attached is a patch. Does this seem sane or is
> there a better way?
Seems okay I guess.  We should probably query the terminal and make
sure it's in utf8 mode before assuming utf8.

Although, it's not clear to me what we would do if it's not in utf8
mode, and you seem to handle non-utf8 about as well as could be
expected, so maybe not worth bothering.

Anyway, looks okay to me.  As you probably guessed, I don't like the names :-)

I would prefer maybe

ply_utf8_string_get_length ()
and
ply_utf8_character_get_size ()

since size normally means "in bytes" and length normally means "in
other units"  (with the oddball exception of strlen which returns a
size instead of a length)

--Ray


More information about the plymouth mailing list