Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#23 Please recode localized messages

closed-fixed
John Horne
Rkhunter (37)
5
2010-07-10
2010-02-27
Julien Valroff
No

Hi,

Translated messages do not display correctly if the translation file is not encoded using the same encoding as the environment.
For example, if a system uses an ISO-8859-1 encoding and the translation is UTF-8, the strings are displayed as follows (for a German system):
Warnung: Ã\234berprüfe auf mögliche Rootkit-Zeichenketten [ Warnung ]
Warnung: Anwendung 'openssl', Version '0.9.8k', ist veraltet und ein mögliches Sicherheitsrisiko.
Eine oder mehrere Warnungen während der System-Ã\234berprüfung gefunden.
Bitte überprüfen Sie die Log-Datei (/var/log/rkhunter.log)

rkhunter should take care of re-encoding the strings (using iconv).
As an alternative, rkhunter could use gettext.

Note this bug report was initially reported against the Debian package at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571333

Cheers,
Julien

Discussion

  • John Horne
    John Horne
    2010-03-05

    Not sure I understand this. Are you saying that the 'de' language file is UTF-8 but not marked as such (and hence displays incorrectly on non-utf8 environments)? The language files are simply provided 'as is'.

     
  • Julien Valroff
    Julien Valroff
    2010-03-06

    Hi,

    Yes, you are right:
    $ file files/i18n/*
    files/i18n/cn: UTF-8 Unicode English text
    files/i18n/de: UTF-8 Unicode English text
    files/i18n/en: ASCII English text
    files/i18n/zh: ISO-8859 English text
    files/i18n/zh.utf8: UTF-8 Unicode English text

    However, the solution is not to mark the UTF8 files as such, but it would be better to recode the messages when they are displayed. I have been advised by other Debian developers to use iconv for that purpose.

    Another better alternative would be to use gettext for i18n.

    Cheers,
    Julien

     
  • John Horne
    John Horne
    2010-07-10

    Fixed in CVS.

    Note: This is a bit of a bodge fix. It uses the 'locale' and 'iconv' commands if they are present. I don't read German, but some very basic testing shows that the output changes and looks more 'correct'. That is, the output does not contain odd glyphs which are obviously not part of the language.

     
  • John Horne
    John Horne
    2010-07-10

    • assigned_to: nobody --> jhorne
    • status: open --> closed-fixed