GNOME Bugzilla – Bug 473040
yelp does not display correctly translated man pages
Last modified: 2010-12-20 18:48:13 UTC
Please describe the problem: I use Fedora 7 with the man-pages-ru package installed, which provides some of the manuals in Russian. However, when I try to display such a manual, it's displayed in the wrong character set. And another problem with this is that when multiple-language manual pages are available, there's no way to select a specific version. This is sometimes needed as the translated manuals can be missing descriptions for newer switches and features. The later problem can be reproduced with the mplayer manual, which has its manual translated into several languages. If you enter "mplayer" into the search box, you should get two or four results (depending if you have installed mencoder or not), but clicking on the english manual gives you the translated version anyway, which is in the wrong encoding. Steps to reproduce: 1. Install man-pages-ru from base repository and possibly mplayer from livna repository. 2. Select "Russian" in GDM login screen and login 3. Run Yelp 4. In the search box enter: "man ls" Actual results: You get the help page filled with garbage, as shown on the screenshot Expected results: I should see the russian text, like 'man' displays on the screenshot. Does this happen every time? yes Other information:
Created attachment 94843 [details] A screenshot with yelp displaying text wrongly and man displaying it correctly
This was already reported in redhat bugzilla [1], but nobody there seems to care. Maybe reporting the issue upstream will help. For reference, issue is present with Polish (pl_PL.utf-8) locale as well. [1] https://bugzilla.redhat.com/show_bug.cgi?id=219912
*** Bug 482644 has been marked as a duplicate of this bug. ***
Created attachment 169920 [details] [review] Patch for yelp-man-document.c Currently yelp has the hardcoded language = "C" and encoding = "ISO-8859-1". Almost man encoding would be UTF-8 so we don't have to use the legacy encodings.
Could you review the patch? On the other hand, I think it might be good to remove langmap. The encoding can be detected from the locale dir.
Why not just take the output encoding from environment variable? I'm still not using utf-8 encoding for a number of reasons, so this patch won't work for me anyway.
I mean, from the standard "LANG" or "LC_MESSAGES" environment variables.
(In reply to comment #6) > Why not just take the output encoding from environment variable? It's also ok with me if the maintainer prefers to get encoding from env. > I'm still not using utf-8 encoding for a number of reasons, so this patch won't work for me > anyway. However I don't understand why this patch doesn't work for you. I checked man-pages-ru and I think the encoding is UTF-8. It means does it work when you run yelp on either ru_UR.UTF-8 or ru_RU.koi8r since the man page files are encoded in UTF-8 ? I think almost Linux man pages are shifted to UTF-8. In some UNIX, the encodings are different by the location of man pages.
Sorry, you are right. I was assuming it is possible to find out somehow a man page's encoding, but now I looked into them and I see that there's no way. So, assuming UTF-8 codepage is the best way, besides newer 'man' just does the same. I can't try your patch because it doesn't apply to yelp-2.30.2, this is the latest version for Fedora14.
(In reply to comment #9) > I can't try your patch because it doesn't apply to yelp-2.30.2, this is the > latest version for Fedora14. FYI: http://fujiwara.fedorapeople.org/yelp/yelp-631657-man-utf8.patch.bak
Applied your patch on yelp 2.30.2 - works just fine. Thank you!
I'm afraid the patch given will no longer apply to the git tree, since we've just completely rewritten the man page handling in master. The good news is that we also fixed the bug :-)
Seems to work for me as well. I'm resolving the bug. Please let me know if there are any further problems.