Date: Fri, 23 Aug 2019 18:13:30 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: cem@freebsd.org Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r351413 - head/usr.bin/last Message-ID: <6af6c95a-4978-6898-4191-01e734ccb298@grosbein.net> In-Reply-To: <361cc2e7-fba5-d724-dcf0-3c4ae3a8ed6f@freebsd.org> References: <201908230125.x7N1PdTN070890@repo.freebsd.org> <CAG6CVpXFtrfrdTJporKx%2BBXif1%2BL-pH_WAzDN%2BB78yugTy7cCA@mail.gmail.com> <361cc2e7-fba5-d724-dcf0-3c4ae3a8ed6f@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6af6c95a-4978-6898-4191-01e734ccb298>