Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

wrong enconding in man pages [NOT solved]

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
Crono81
Tux's lil' helper
Tux's lil' helper
Posts: 87
Joined: Tue Nov 07, 2006 9:18 pm

wrong enconding in man pages [NOT solved]

  • Quote

Post by Crono81 » Thu Nov 23, 2006 1:31 pm

Man pages in my language (italian) have a bad encoding: words like "può" look like "puA2" and so on. This happens both on text consoles and on terminals (like konsole). How to fix that?

Some basic infos:

Code: Select all

Crono ~ # locale
LANG=it_IT@euro
LC_CTYPE="it_IT@euro"
LC_NUMERIC="it_IT@euro"
LC_TIME="it_IT@euro"
LC_COLLATE="it_IT@euro"
LC_MONETARY="it_IT@euro"
LC_MESSAGES="it_IT@euro"
LC_PAPER="it_IT@euro"
LC_NAME="it_IT@euro"
LC_ADDRESS="it_IT@euro"
LC_TELEPHONE="it_IT@euro"
LC_MEASUREMENT="it_IT@euro"
LC_IDENTIFICATION="it_IT@euro"
LC_ALL=

Crono ~ # locale -a
C
en_US
en_US.utf8
it_IT
it_IT@euro
POSIX
Last edited by Crono81 on Thu Nov 30, 2006 11:18 am, edited 2 times in total.
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Thu Nov 23, 2006 2:35 pm

My locale is cs_CZ.iso8859-2 and I am suffering the same problems with 3/4, A2 and similar stuff appearing in localised manpages. I am therefore using only the English ones - it has been like this for a very long time. Actually, when you open up the man page in a text editor, the econding is OK. I guess that the "man" program is simply having trouble with that. :(
Top
Crono81
Tux's lil' helper
Tux's lil' helper
Posts: 87
Joined: Tue Nov 07, 2006 9:18 pm

  • Quote

Post by Crono81 » Thu Nov 23, 2006 4:52 pm

you may try to open /etc/man.conf and edit the line that starts with NROFF (can't remember it now, however there are some UTF8 comments above). Try to cut the -Tascii option and see if it's going to work for you.. not for me :(
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Sat Nov 25, 2006 11:49 pm

Hmm, I tried playing with the nroff/troff settings, but it does nothing. :(
Top
SirYes
Apprentice
Apprentice
User avatar
Posts: 282
Joined: Sun Jan 15, 2006 10:14 am
Location: Lodz, Poland
Contact:
Contact SirYes
Website

  • Quote

Post by SirYes » Mon Nov 27, 2006 10:33 pm

I use a system-wide pl_PL.UTF-8 encoding. However, most manual pages that have Polish versions are in the 8-bit ISO-8859-2 encoding. In the end I came up with this setup:

Code: Select all

NROFF           /usr/bin/nroff -Tlatin1 -c -mandoc -p
COL             /usr/bin/iconv -f iso-8859-2 -t utf-8
This effectively tells man not to clobber anything with NROFF, and convert 8-bit encoding to the UTF-8 one, using a non-standard COL program.

An ugly hack, but it works for me. And it is ugly, because it shouldn't be needed - but as of today man and groff don't support UTF-8 locales for their output very well. Additionally, this is also a system-wide setting (bad!) and completely misses the situation where there are many users on the system that use different locales (think: multiuser server).

If you're inclined to try this, be sure to specify the right input locale instead of "iso-8859-2" in the iconv invocation. Good luck! ;)
My blog: In search for ultimate programming language
Top
Crono81
Tux's lil' helper
Tux's lil' helper
Posts: 87
Joined: Tue Nov 07, 2006 9:18 pm

  • Quote

Post by Crono81 » Tue Nov 28, 2006 1:30 pm

It's an ugly hack but using iconv actually works.

I use this for italian man pages:

Code: Select all

NROFF           /usr/bin/nroff -Tlatin1 -c -mandoc -p
COL             /usr/bin/iconv -f utf-8 -t iso-8859-1
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Tue Nov 28, 2006 6:49 pm

Thanks for the tips. I tried:
/etc/man.conf:

Code: Select all

NROFF           /usr/bin/nroff -Tlatin2 -c -mandoc -p
COL             /usr/bin/iconv -f utf-8 -t iso-8859-2
But it did not help. The manpages are obviously encoded in ISO-8859-2... but no matter what I tried with COL, it did not make the output correct.
Top
Crono81
Tux's lil' helper
Tux's lil' helper
Posts: 87
Joined: Tue Nov 07, 2006 9:18 pm

  • Quote

Post by Crono81 » Tue Nov 28, 2006 7:19 pm

did you also try the opposite

Code: Select all

COL             /usr/bin/iconv -f iso-8859-2 -t utf-8 
(from 8859 to utf)?
Top
selig
Guru
Guru
User avatar
Posts: 425
Joined: Sun Jul 31, 2005 4:58 pm
Location: Prague, Czech Republic

  • Quote

Post by selig » Tue Nov 28, 2006 7:42 pm

Yes, it did absolutely nothing - the display of characters with these option is the same as without them (both the NROFF and COL options). Some NROFF options produced unusable output, which did not even get displayed. COL options seem to have no effect whatsoever. My terminal encoding is ISO-8859-2, the manpages are in ISO-8859-2, almost everything in my system is ISO-8859-2. I really don't see what problems "man" is having.

I will now try

Code: Select all

TROFF           groff -Tps -man
NROFF           nroff --legacy NROFF_OLD_CHARSET -man
EQN             /usr/bin/geqn -Tps
NEQN            /usr/bin/geqn -Tutf8
TBL             /usr/bin/gtbl
# COL           /usr/bin/col
REFER           /usr/bin/grefer
PIC             /usr/bin/gpic
VGRIND
GRAP
PAGER           /usr/bin/less -iRs
CAT             /bin/cat
Last edited by selig on Wed Jan 03, 2007 3:31 pm, edited 1 time in total.
Top
Crono81
Tux's lil' helper
Tux's lil' helper
Posts: 87
Joined: Tue Nov 07, 2006 9:18 pm

  • Quote

Post by Crono81 » Thu Nov 30, 2006 11:20 am

well however that was not a solution. Some man pages have strange characters for indented lists, and the page becomes unreadable. That iconv should work only on pages that effectively need to be translated, not ALL...
Top
Post Reply

10 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy