LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-02-2012, 10:48 AM   #1
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
LANG=fr_FR.utf8 vs. french man pages


Hi,

I'd like to have my Slackware 14.0 system completely in French, including man pages. I have a little problem with these.

Here's what I put in my /etc/profile.d/lang.sh:

Code:
export LANG=fr_FR.utf8
export LC_COLLATE=fr_FR.utf8
And here's /etc/rc.d/rc.font:

Code:
#!/bin/sh
#
# This selects your default screen font from among the ones in
# /usr/share/kbd/consolefonts.
#
setfont -v lat9w-16
A stock Slackware 14.0 system already ships a handful of man pages translated into French, under /usr/man/fr. For example :

Code:
$ man time
Or:

Code:
$ man nmap
Unfortunately, these man pages display the usual suspects of random character soup instead of french special characters like "", "", "", "", and so on.

I have the same problem when I install some external (UTF-8-encoded) french man pages from here: http://manpagesfr.free.fr. So I vaguely guess the problem doesn't originate from the pages themselves.

Hmmm. As is often the case with problems related to encoding, I'm clueless.

Last edited by kikinovak; 12-02-2012 at 10:49 AM.
 
Old 12-02-2012, 11:20 AM   #2
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 61

Rep: Reputation: 21
Hi,

As usual, there are only awkward solutions. You can edit your /usr/lib/man.conf to force groff to interpret the man-pages as an UTF-8 encoded source (the French man-pages are rendered broken because groff sees them as latin1-encoded):

Code:
NROFF       /usr/bin/groff -K utf8 -mandoc -Tutf8
But then, the man-page encoded in latin(9|1) will be displayed broken. The second solution is to convert the French man-pages into iso-8859-1 using iconv. That's what I used to do when I was installing them (they're not up-to-date anymore, be careful). The conversion works well, except for the pages about the different charsets in 7, but who reads that?

Last edited by NonNonBa; 12-02-2012 at 11:21 AM.
 
2 members found this post helpful.
Old 12-02-2012, 11:42 AM   #3
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Original Poster
Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Thanks very much! I fiddled around some more and finally managed to get it right. I converted all the man pages to latin1 before installing them, and they display OK now.

Cheers,

Niki
 
Old 12-02-2012, 11:42 AM   #4
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 14.1 64bit
Posts: 729
Blog Entries: 3

Rep: Reputation: 78
I also use "LANG=fr_FR.UTF-8".

With Slackware (and maybe with other distro), it seems that french man pages are shipped in various encodings:

Code:
$ls /usr/man/fr*
/usr/man/fr:
man1  man3  man5  man6	man8

/usr/man/fr.ISO8859-1:
man1

/usr/man/fr.UTF-8:
man1
man pages located in the fr.UTF-8 sub-directory are correctly displayed. For example:

Code:
$man vim
Other pages not stored in this sub-directory won't display correctly most probably because they are not UTF-8 encoded.

So I suspect that you just need additional french man pages encoded in UTF-8 with no need to change any man configuration options.
 
Old 12-02-2012, 12:57 PM   #5
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 61

Rep: Reputation: 21
Quote:
Originally Posted by gegechris99 View Post
I also use "LANG=fr_FR.UTF-8".

man pages located in the fr.UTF-8 sub-directory are correctly displayed. For example:

Code:
$man vim
Other pages not stored in this sub-directory won't display correctly most probably because they are not UTF-8 encoded.

So I suspect that you just need additional french man pages encoded in UTF-8 with no need to change any man configuration options.
Nope.

vim.1 is correctly displayed because encoded in latin1 and therefore rightly converted in UTF-8 (� means "non-sense in UTF-8"):

Code:
$ zcat /usr/man/fr/man1/vim.1.gz
.br
Cette page de manuel a �t� mise � jour par David Blanchet.
<david.blanchet@free.fr> 2006-04-10.
/usr/man/<local>.<charset> are directories for man-db, not the implementation of man Slackware uses:

Code:
$ man -w vim
/usr/man/fr/man1/vim.1.gz
 
Old 12-02-2012, 01:51 PM   #6
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Original Poster
Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
NonNonBa is right. Manpages have to be latin1-encoded to be displayed correctly with french special characters.
 
Old 12-02-2012, 04:35 PM   #7
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 14.1 64bit
Posts: 729
Blog Entries: 3

Rep: Reputation: 78
OK, I was wrong: I was just trying to advance the topic

Quote:
Originally Posted by kikinovak View Post
I converted all the man pages to latin1 before installing them, and they display OK now.
I'm interested in knowing how you did the conversion to latin1 of existing man pages (ex: nmap). Thank you.
 
Old 12-02-2012, 05:23 PM   #8
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Original Poster
Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Quote:
Originally Posted by gegechris99 View Post
I'm interested in knowing how you did the conversion to latin1 of existing man pages (ex: nmap). Thank you.
I didn't. Encoding for this one is still wrong.

Guess I'll have to write a little script that scans /usr/man/fr for UTF-8-encoded pages and automatically converts them to LATIN1.
 
Old 12-03-2012, 06:30 AM   #9
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 61

Rep: Reputation: 21
For the French man-pages archive, there's an option in the configure to perform the conversion. I don't remember if the maintainer had included the other build process I made for man-pages-extras.

For the broken pages of the other packages, there's another solution I haven't thought to:

Code:
$ alias uman='GROFF_ENCODING=utf8 man'
$ uman nmap
Thus, you don't need to touch anything. If a page is rendered broken, just reload it with uman.
 
4 members found this post helpful.
Old 12-03-2012, 10:33 AM   #10
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Original Poster
Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Quote:
Originally Posted by NonNonBa View Post
For the French man-pages archive, there's an option in the configure to perform the conversion. I don't remember if the maintainer had included the other build process I made for man-pages-extras.

For the broken pages of the other packages, there's another solution I haven't thought to:

Code:
$ alias uman='GROFF_ENCODING=utf8 man'
$ uman nmap
Thus, you don't need to touch anything. If a page is rendered broken, just reload it with uman.
This is a GREAT idea. You deserve at least a dozen "found this helpful" clicks for this one.

Thanks a lot!
 
Old 12-03-2012, 10:55 AM   #11
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,533

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
IMO the solution proposed by NonNonBa is of course the best one, at least until all man pages in Slackware be shipped in UTF-8 encoding.

@NonNonBa aka Seb: By the way, do you remember your promise to launch the "UTF-8 Slackware" project?

Last edited by Didier Spaier; 12-03-2012 at 10:57 AM.
 
Old 12-03-2012, 05:40 PM   #12
gegechris99
Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 14.1 64bit
Posts: 729
Blog Entries: 3

Rep: Reputation: 78
Thumbs up Thanks for the tip

Quote:
Originally Posted by NonNonBa View Post
Code:
$ alias uman='GROFF_ENCODING=utf8 man'
$ uman nmap
Thank you. I'm glad I learned something from my mistake
 
Old 12-04-2012, 12:50 PM   #13
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 61

Rep: Reputation: 21
@kikinovak, gegechris99: You're welcome.

@Didier Spaier: Yes, I remember I promised a thread.
I wanted to finish the howto about TeX Live first, and caught a nasty little virus in the meanwhile. But I didn't forget, it's in the TODO, don't worry.
 
Old 12-04-2012, 02:41 PM   #14
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,866

Original Poster
Rep: Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936Reputation: 936
Of course the cleanest solution would be a script that scans everything in /usr/man, hunts down utf8-encoded man pages and converts them to latin1. This is slightly over my scripting abilities, but I've started to experiment nevertheless.
 
Old 12-04-2012, 02:50 PM   #15
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,533

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Quote:
Originally Posted by kikinovak View Post
Of course the cleanest solution would be a script that scans everything in /usr/man, hunts down utf8-encoded man pages and converts them to latin1. This is slightly over my scripting abilities, but I've started to experiment nevertheless.
I would certainly prefer the other way round. UTF-8 is the future.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
man pages help vijaya_svk Linux - Newbie 4 07-14-2008 02:51 PM
C++ man pages Guest1234 Linux - Newbie 2 06-29-2008 10:12 AM
GTK1 not understanging UTF8?, LANG=pl_PL.UTF-8 qs-raven Linux - Software 5 12-03-2006 09:31 AM
man pages q. jnusa Linux - Software 6 02-03-2006 09:40 AM
man pages? southsibling Linux - Newbie 2 08-31-2003 12:04 PM


All times are GMT -5. The time now is 12:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration