Comment 3 for bug 211710

Revision history for this message
J.B. Langston III (jb-langston) wrote : Re: Wrong characters codification in Xaos translation.

This issue has been resolved in the upstream CVS and will be included in the upcoming 3.4 release. The problem is that XaoS's built-in text handling (the xprint function in grlib.c) only supports Latin-1 and Latin-2 encodings. On modern Linux systems (and Mac OS X), gettext returns strings in UTF-8. The solution is to convert the strings from UTF-8 back to Latin-1 or Latin-2 as appropriate before displaying them using XaoS's xprint function.

The meat of the changes are in grlib.c, but also, every call to xprint had to be updated to pass in the proper encoding, which is stored in the uih->encoding field (an integer 1 or 2 indicating Latin-1 or Latin-2 or 0 indicating that the encoding should not be changed). For the help and
tutorials, we pass in a 0 to prevent the text from being re-encoded. Tutorials pull strings directly from the appropriate catalog file instead of using gettext, so the text is already in the proper encoding. Help is not localized at all, so it also does not need to be re-encoded.

You may be able to use this fix against the 3.2 version that is included in ubuntu. You can probably use grlib.c directly as I don't think it contains any other changes between 3.2 until now. However, you will need to hand patch the files that call the xprint function, since these files may contain other changes between 3.2 and now. I would encourage Ubuntu to upgrade the package to the latest version. In addition to this fix, 3.3 (and the upcoming 3.4) will contain numerous other fixes, as well as an extremely important new feature, the ability to render user-defined formulas. Debian has already moved to 3.3 in testing and unstable. I will let you know when 3.4 has been released (it may be a few more weeks yet).