Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to NOT use UTF-8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
linolium
Tux's lil' helper
Tux's lil' helper


Joined: 14 Sep 2003
Posts: 75
Location: BC, Canada

PostPosted: Fri Nov 24, 2006 1:20 am    Post subject: How to NOT use UTF-8 Reply with quote

Yes, I know I am probably going to get flamed for this, but the topic is indeed how to not use UTF-8:

How to NOT use UTF-8

Why?

Because it is simpler to not have to configure each application to use Unicode and deal with inconsistencies and bugs. It also makes your box a lot more interoperable with Windows via FTP, SSH, or whatever it may be. Because it just works.

What works, you may ask? Accented letters do. Or at least the French ones, e.g. éàêíèôà. If you are getting a bunch of question marks displayed in place of the accents in bash or in a console, or over SSH perhaps in PuTTY, then you are most likely suffering from this problem. Instead of converting to Unicode and having to worry about convmv and everything else, it is just easier to fall back on ISO-8859. I feel I have a responsibility to post this because I spent about a week trying to fix it, and finally realized the simple solution.

How?

Step One

Make sure you have your locale for ISO-8859 in /etc/locale.gen:

Code:
en_US ISO-8859-1
en_CA ISO-8859-1
en_GB ISO-8859-1
de_DE ISO-8859-1
de_DE@euro ISO-8859-15

Then run:

Code:
locale-gen.

Step Two

Set the default system locale in /etc/env.d/02locale:

Code:
echo 'LANG="en_CA.ISO-8859-1"' >> /etc/env.d/02locale

(or edit the file)

Now update the environment:

Code:
env-update
source /etc/profile

Step Three
If you are using Samba ensure the top of your /etc/samba/smb.conf file is configured thusly:

Code:
[global]
  dos charset = 850
  unix charset = ISO-8859-1
  display charset = ISO-8859-1

... and that's all!

Addendum

When mounting a volume from one system configured thusly to another, it seems to screw up accents somewhat. The way to fix this is by just mounting using cifs instead of smb:

Code:
mount -t cifs //gentoo/homes /mnt/gentoo


Any questions/comments/flames? Please post below!


Last edited by linolium on Fri Nov 24, 2006 11:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dralnu
Veteran
Veteran


Joined: 24 May 2006
Posts: 1919

PostPosted: Fri Nov 24, 2006 2:38 am    Post subject: Reply with quote

Um, what about using both?

I went to convert to UTF-8, had problems, and now I've got ISO and UTF in my locales, and everything seems to work. UTF, where applicable, works, and so does most every thing else...
_________________
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Back to top
View user's profile Send private message
Crono81
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2006
Posts: 86

PostPosted: Fri Nov 24, 2006 10:36 am    Post subject: Reply with quote

linolium, do you know how to get rid of the unicode encoding from the localized man pages? All the italian man pages have A2 A""" and others strange chars.

I tried to remove unicode from USE, reemerged man, groff and the applications with the italian man pages, but nothing...
Back to top
View user's profile Send private message
Konsti
l33t
l33t


Joined: 10 Dec 2002
Posts: 691

PostPosted: Fri Nov 24, 2006 4:10 pm    Post subject: Reply with quote

How funny is this, I started a thread this morning on HowTo get rid of this. I must admint it was a rant partly.
https://forums.gentoo.org/viewtopic-t-518929.html
I must have overlooked this one.

Is it right the issue ssh'ing into a unicode box messes up everything can't really be fixed?
_________________
konsti@jabber.org
Back to top
View user's profile Send private message
linolium
Tux's lil' helper
Tux's lil' helper


Joined: 14 Sep 2003
Posts: 75
Location: BC, Canada

PostPosted: Fri Nov 24, 2006 11:10 pm    Post subject: Reply with quote

@Dralnu: I suppose you are correct. I have taken -unicode out of my use flags and recompiled everything and it still works. Thus I have decided to remove the portion from the first post.

@Crono81: I have never used non-english man pages but my only idea would be that it is characters not supported in the locale. I am probably wrong but perhaps someone else would care to enlighten us?

@Konsti: I searched for hours on end for something and I never even thought it would be something as simple as setting LANG to have an ISO-8859-1 locale in it. Hopefully this thread will come up when people are searching for the question-mark problem and such. Whether it is the only way of fixing it, I don't know, but everything else I tried did not completely fit my requirements.
Back to top
View user's profile Send private message
numeritos
Apprentice
Apprentice


Joined: 24 Nov 2006
Posts: 154

PostPosted: Tue Nov 28, 2006 7:06 pm    Post subject: Reply with quote

In my /etc/env.d/02locale I have LC_ALL variable instead of LANG. Is it the same?[/topic]
Back to top
View user's profile Send private message
linolium
Tux's lil' helper
Tux's lil' helper


Joined: 14 Sep 2003
Posts: 75
Location: BC, Canada

PostPosted: Tue Nov 28, 2006 11:02 pm    Post subject: Reply with quote

numeritos wrote:
In my /etc/env.d/02locale I have LC_ALL variable instead of LANG. Is it the same?[/topic]


This page http://mail.nl.linux.org/linux-utf8/2003-03/msg00025.html does a good job of explaining why LANG should be used over LC_ALL.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum