# How can I alter my locale and remove LANG=en_US ISO-8859-1?

## cgmd

Hi, all...

How do I modify the output of locale?:

```

 # locale

LANG=en_US ISO-8859-1

LC_CTYPE="en_US"

LC_NUMERIC="en_US"

LC_TIME="en_US"

LC_COLLATE="en_US"

LC_MONETARY="en_US"

LC_MESSAGES="en_US"

LC_PAPER="en_US"

LC_NAME="en_US"

LC_ADDRESS="en_US"

LC_TELEPHONE="en_US"

LC_MEASUREMENT="en_US"

LC_IDENTIFICATION="en_US"

LC_ALL=en_US

```

The line LANG=en_US ISO-8859-1 appears to be causing me problems. I don't recall what steps are necessary to remove it.   :Sad: 

Can someone please shed some light on it for me?

Thanks!

----------

## Jaglover

http://www.gentoo.org/doc/en/utf-8.xml

It is about UTF-8, but it doesn't matter.

----------

## coolsnowmen

have you seen this?

http://www.gentoo.org/doc/en/guide-localization.xml

----------

## cgmd

I have used both of the above mentioned links...

My  /etc/env.d/02locale  contains only:

```

LANG=en_US

LC_ALL=en_US

```

Also, I have run locale-gen after completely commented out the contents of /etc/locale.gen:

```

# /etc/locale.gen: list all of the locales you want to have on your system

#

# The format of each line:

# <locale> <charmap>

#

# Where <locale> is a locale located in /usr/share/i18n/locales/ and

# where <charmap> is a charmap located in /usr/share/i18n/charmaps/.

#

# All blank lines and lines starting with # are ignored.

#

# For the default list of supported combinations, see the file:

# /usr/share/i18n/SUPPORTED

#

# Whenever glibc is emerged, the locales listed here will be automatically

# rebuilt for you.  After updating this file, you can simply run `locale-gen`

# yourself instead of re-emerging glibc.

#en_US ISO-8859-1

#en_US.UTF-8 UTF-8

#ja_JP.EUC-JP EUC-JP

#ja_JP.UTF-8 UTF-8

#ja_JP EUC-JP

#en_HK ISO-8859-1

#en_PH ISO-8859-1

#de_DE ISO-8859-1

#de_DE@euro ISO-8859-15

#es_MX ISO-8859-1

#fa_IR UTF-8

#fr_FR ISO-8859-1

#fr_FR@euro ISO-8859-15

#it_IT ISO-8859-1

```

In spite of that I still get the LANG=en_US ISO-8859-1 reference I wish to eliminate.    :Sad: 

----------

## cgmd

I also now notice:  

```

# env | grep -i LC_

LC_PAPER=en_US.ISO-8859-1

LC_ADDRESS=en_US.ISO-8859-1

LC_MONETARY=en_US.ISO-8859-1

LC_NUMERIC=en_US.ISO-8859-1

LC_ALL=en_US

LC_TELEPHONE=en_US.ISO-8859-1

LC_MESSAGES=en_US.UTF8

LC_IDENTIFICATION=en_US.ISO-8859-1

LC_COLLATE=en_US.UTF8

LC_MEASUREMENT=en_US.ISO-8859-1

LC_CTYPE=en_US.UTF8

LC_TIME=en_US.ISO-8859-1

LC_NAME=en_US.ISO-8859-1

```

Anyone with an idea how to clean this up?   :Confused: 

----------

## coolsnowmen

 *cgmd wrote:*   

> I have used both of the above mentioned links...
> 
> My  /etc/env.d/02locale  contains only:
> 
> ```
> ...

 

so change that to

```

LANG=""

LC_ALL=""

```

env-update

source /etc/profile

locale

depending on the options, I think simply commenting out the generated locales and then running locale-gen either did nothing, or activly deleted the files that your system needs.  Having them in that file doesn't change the environment variable

----------

## cgmd

 *coolsnowmen wrote:*   

>  *cgmd wrote:*   I have used both of the above mentioned links...
> 
> My  /etc/env.d/02locale  contains only:
> 
> ```
> ...

 

OK... Definite improvement:

```
cgmd # locale

LANG=en_US ISO-8859-1

LC_CTYPE="en_US"

LC_NUMERIC="en_US"

LC_TIME="en_US"

LC_COLLATE="en_US"

LC_MONETARY="en_US"

LC_MESSAGES="en_US"

LC_PAPER="en_US"

LC_NAME="en_US"

LC_ADDRESS="en_US"

LC_TELEPHONE="en_US"

LC_MEASUREMENT="en_US"

LC_IDENTIFICATION="en_US"

LC_ALL=en_US

```

But still have LANG=en_US ISO-8859-1...

What do you think  can I attribute that to?

Thanks for your help with this!

----------

## cgmd

The more I work with this, the less I understand about defining environment variables. Having just reinstalled glibc, I now have the following:

```

 # locale

LANG=

LC_CTYPE=en_US.UTF8

LC_NUMERIC=en_US.ISO-8859-1

LC_TIME=en_US.ISO-8859-1

LC_COLLATE=en_US.UTF8

LC_MONETARY=en_US.ISO-8859-1

LC_MESSAGES=en_US.UTF8

LC_PAPER=en_US.ISO-8859-1

LC_NAME=en_US.ISO-8859-1

LC_ADDRESS=en_US.ISO-8859-1

LC_TELEPHONE=en_US.ISO-8859-1

LC_MEASUREMENT=en_US.ISO-8859-1

LC_IDENTIFICATION=en_US.ISO-8859-1

LC_ALL=

```

At last, I have "LANG= and not ""LANG=en_US ISO-8859-1"!

But, I have also picked up "en_US.UTF8" or "en_US.ISO-8859-1" for all the other variables...

How can I get back to all the other variables being defined "en_US"?

Would someone please help me with this?

----------

## rofro

first in file /etc/locale.gen

```
en_US ISO-8859-1

en_US.UTF-8 UTF-8
```

then enter this command to generate specified locales

```
locale-gen
```

you can see available locales running

```
locale -a
```

in file /etc/env.d/02locale

```
LANG="en_US"
```

then run

```
env-update && source /etc/profile
```

and check

```
locale
```

----------

