svn commit: r351413 - head/usr.bin/last

Eugene Grosbein eugen at grosbein.net
Fri Aug 23 11:13:49 UTC 2019


23.08.2019 17:38, Eugene Grosbein wrote:

>> Should this be done more generally?  Last time I looked it seemed like
>> libxo was completely locale-unaware and just assumed all input was
>> UTF-8.  It might make more sense to have libxo take locale into
>> account when formatting %s strings.
> 
> libxo is locale-aware but in its own quite peculiar way, as libxo(3) tells:
>>      For strings, the 'h' and 'l' modifiers affect the interpretation of the
>>      bytes pointed to argument.  The default '%s' string is a 'char *' pointer
>>      to a string encoded as UTF-8.  Since UTF-8 is compatible with ASCII data,
>>      a normal 7-bit ASCII string can be used.  "%ls" expects a "wchar_t *"
>>      pointer to a wide-character string, encoded as 32-bit Unicode values.
>>      "%hs" expects a "char *" pointer to a multi-byte string encoded with the
>>      current locale, as given by the LC_CTYPE, LANG, or LC_ALL environment
>>      variables.

Sorry, this is from xo_format(5) actually.



More information about the svn-src-all mailing list