You are not logged in.

#1 2007-08-14 15:12:29

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Fixing man pages when using utf-8

I'm not so newbie with linux (and archlinux), but sometimes I encounter situations I haven't experienced before.

From the beginning I chosed to use the old iso locale, but recently I encountered a problem with openoffice: since I'm from sweden, I use 'å' 'ä' and 'ö' characters, and they work good when I'm writing a text in Writer, but when I use one or more of them in the name of a directory, under which I save a text file, Writer gives me an error message of the directory not existing. Since the error message showed me the classic unicode in iso problem (an unicode 'ö' being interpreted as "ö" in the old iso charcode, for example) for the path, I decided that it was time to switch to utf-8 once and for all (since it's the future character coding wink ), and that corrected the problem.

So now I'm using utf-8 as standard, and most things work great. But there's two problems:

* In the login promt wont accept foreign character ('ö' being interpreted as "ö" as I wrote above), and after I have typed a foreign character, the text cant be removed (and I have to do a login attempt to the non-existing account to clear the login-name field.

* When I'm reading a translated man page, the foreign characters are displayed wrong.

The first problem is not important, since I'm using the normal a-z charset for account name and password, the other one is more annoying. It seems like the man pages are written in the old iso standard, and they are (incorrectly) being interpreted as utf-8) And I'm not sure what would be the best solution. What happens is that the foreign character is rendered as a square/"non render able character", and the next character are being removed (since foreign characters in utf-8 are coded as two characters, it's quite a logical problem), for example (from the mplayer manual: "De flesta stödjer mjukvaro och hårdvaruskalning" gets replaced with: "De flesta stjer mjukvaro och hdvaruskalning"

any help/idea would be appreciated. wink

Offline

#2 2007-08-14 15:38:59

Mefju
Member
From: Poland
Registered: 2006-07-12
Posts: 104

Re: Fixing man pages when using utf-8

For man pages and utf-8 I do some dirty trick in /etc/man.conf

NROFF        /usr/bin/nroff -Tlatin1 -mandoc -c | iconv -f ISO-8859-2 -t UTF8

As far as I remember in Sweden people using  iso-8859-1 or iso-8859-15 encoding, so you have to modify it to

NROFF        /usr/bin/nroff -Tlatin1 -mandoc -c | iconv -f ISO-8859-1 -t UTF8

Last edited by Mefju (2007-08-14 15:39:39)

Offline

#3 2007-08-14 15:54:21

gothmog.todi
Member
From: Austria
Registered: 2007-07-18
Posts: 120

Re: Fixing man pages when using utf-8

I had a similar problem with german characters. I'm not quite sure if it will help you, because i used utf8 from the start, but i changed the following 2 lines in my /etc/man.conf:

NROFF        /usr/bin/nroff -Tlatin1 -mandoc -c
NEQN        /usr/bin/geqn -Tlatin1

to:

NROFF           /usr/bin/nroff -Tutf8 -mandoc -c
NEQN            /usr/bin/geqn -Tutf8

additionally you should change the following line in your /etc/profile:

export LESSCHARSET="latin1"

to this:

export LESSCHARSET="utf-8"

Last edited by gothmog.todi (2007-08-14 15:58:16)

Offline

#4 2007-08-16 07:54:45

geshido
Member
Registered: 2007-03-05
Posts: 1

Re: Fixing man pages when using utf-8

Thank you a lot for LESSCHARSET tip!

Offline

#5 2007-08-18 11:19:29

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Fixing man pages when using utf-8

Thanks allot, both of you!
I don't think I've looked into the /etc/profile script before, very interesting big_smile
Also, I didn't know man had a config file, that was also interesting lol

I'm going to play around with those files, it should be all that's necessary to correct this problem, thanks!

Offline

#6 2007-08-24 17:12:52

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Fixing man pages when using utf-8

I have set LESSCHARSET to utf-8, and have added (replaced the old NROFF) the following to man.conf:

NROFF           /usr/bin/nroff -Tlatin1 -mandoc -c | iconv -f latin1 -t UTF8

And it fixes the mplayer manpage smile

But it causes the useradd manpage to become incorrect (like it's coded in utf-8 and rendered in the old iso: 'ä' becomes 'ä' , and similar).
Anyone got any idea? hmm


(also, all thought it doesn't matter so much for me, I would be very interested to know how to make agetty respond to the input as utf-8, is there any parameter I'll need to give it? tongue)

Offline

Board footer

Powered by FluxBB