[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Support for non UTF8 encodings



On Fri, Feb 26, 2010 at 03:35:20PM +0100, Julien Valroff wrote:
> A user recently reported a bug[0] regarding localized messages from
> rkhunter not being correctly displayed with other encodings than UTF-8.
> 
> This is simply caused by the translations being encoded in UTF-8.
> 
> UTF-8 being the default encoding for new installations, I am not sure
> whether other encodings should absolutely be supported. Am I right?
> What do you think of it?

There's no requirement that Unicode localised messages only use the
Unicode subset represented by the legacy encoding for the
locale/language.  Otherwise, we would be stuck using limited character
sets for ever.  The localisation machinery should however contain some
fallbacks (transliterations) for non-represented characters which are
a best effort, albeit lossy, conversion.  For example, ‘“”’ → ‘""’.

That said, this doesn't look like this is what is happening in this
case.  In this case, the localised messages are not being recoded
from UTF-8 to the locale charmap at runtime, and this is the cause
of the corrupted output.  This is a bug.  Localisation systems
such as gettext (what pretty much everything uses) will automatically
recode from the .po/.mo translation encoding to the locale encoding
('locale -k charmap').  If this isn't happening, rkhunter's
localisation is broken.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature


Reply to: