How to change from UTF-8 to ISO-8859?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How to change from UTF-8 to ISO-8859?
How can I change my locale to use ISO-8859-1 instead of the default UTF-8?
OS: Linux Mint 14 (XFCE), 64-bit
OS: Linux Mint 14 (XFCE), 64-bit
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: How to change from UTF-8 to ISO-8859?
System Tools > System Settings > Language Supportioctlvoid wrote:How can I change my locale to use ISO-8859-1 instead of the default UTF-8?
OS: Linux Mint 14 (XFCE), 64-bit
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Re: How to change from UTF-8 to ISO-8859?
This can't possibly be right.TehGhodTrole wrote:System Tools > System Settings > Language Supportioctlvoid wrote:How can I change my locale to use ISO-8859-1 instead of the default UTF-8?
OS: Linux Mint 14 (XFCE), 64-bit
In "Language Support" I'm able to select "langauge for menus and windows", "Install / Remove Languages ...", "Keyboard input method system" and change regional formats. However, there is no way for me to change the character encoding.
How can I change the character encoding?
Re: How to change from UTF-8 to ISO-8859?
I don't recommend doing this, as UTF-8 supports all characters from ISO-8859-1, but not the other way around. You may end up with garbage characters: http://unix.stackexchange.com/questions ... -terminal/. I'll outline the steps below, but I urge you to also share why you want to do this as there may be a better way without dropping UTF-8, which is recommend to be used on Linux these days.
Edit your /var/lib/locales/supported.d/local file as root:
Add a line for each language you want with ISO-8859-1, for example for en_US you would add:
Enable the new encodings:
Finally, edit your /etc/default/locale file as root and set your preferences there:
For the above example, I would set:
If you have any LC_ variable defined in your /etc/default/locale, you would update these also. Reboot to activate. To undo the changes you did, just revert your /etc/default/locale to its previous setting (probably LANG="en_US.UTF-8").
Again, I urge you to reconsider this course of action. If you have some text files in ISO-8859-1 format for example, you can use the Linux recode command to convert between character sets (converting the files to UTF-8 format).
Edit your /var/lib/locales/supported.d/local file as root:
Code: Select all
gksudo gedit /var/lib/locales/supported.d/local
Code: Select all
en_US.ISO-8859-1 ISO-8859-1
Code: Select all
sudo dpkg-reconfigure locales
Code: Select all
gksudo gedit /etc/default/locale
Code: Select all
LANG="en_US.ISO-8859-1"
Again, I urge you to reconsider this course of action. If you have some text files in ISO-8859-1 format for example, you can use the Linux recode command to convert between character sets (converting the files to UTF-8 format).
Re: How to change from UTF-8 to ISO-8859?
Thanks, this actually worked.xenopeek wrote:I don't recommend doing this, as UTF-8 supports all characters from ISO-8859-1, but not the other way around. You may end up with garbage characters: http://unix.stackexchange.com/questions ... -terminal/. I'll outline the steps below, but I urge you to also share why you want to do this as there may be a better way without dropping UTF-8, which is recommend to be used on Linux these days.
Edit your /var/lib/locales/supported.d/local file as root:Add a line for each language you want with ISO-8859-1, for example for en_US you would add:Code: Select all
gksudo gedit /var/lib/locales/supported.d/local
Enable the new encodings:Code: Select all
en_US.ISO-8859-1 ISO-8859-1
Finally, edit your /etc/default/locale file as root and set your preferences there:Code: Select all
sudo dpkg-reconfigure locales
For the above example, I would set:Code: Select all
gksudo gedit /etc/default/locale
If you have any LC_ variable defined in your /etc/default/locale, you would update these also. Reboot to activate. To undo the changes you did, just revert your /etc/default/locale to its previous setting (probably LANG="en_US.UTF-8").Code: Select all
LANG="en_US.ISO-8859-1"
Again, I urge you to reconsider this course of action. If you have some text files in ISO-8859-1 format for example, you can use the Linux recode command to convert between character sets (converting the files to UTF-8 format).
I'll tell you why I want ISO-8859. From my past experience there will sooner or later occur some sort of problem related to UTF-8 that will have to be sorted out by switching to ISO-8859. This was a bigger problem before than it is now, but it is still an issue.
E.g. when I SSH to a particular machine running ISO-8859 I get very strange behavior in pine when I'm using that program. I tried to switch to UTF-8 on that remote system, but it didn't help. Now with ISO-8859, everything works perfectly fine.
Re: How to change from UTF-8 to ISO-8859?
In that case, I'd revert /etc/default/locale to its previous configuration (probably LANG="en_US.UTF-8"). When you need to use a program for with UTF-8 is a problem, change the command to start the program to:
For example, with ssh, instead of doing:
you would do:
That should work. You have already enable support for en_US.ISO-8859-1, so you can use it for a single program or command as needed by prefixing it like this. This works for graphical applications as well.
Code: Select all
LANG="en_US.ISO-8859-1" command
Code: Select all
ssh username@remotehost.tld
Code: Select all
LANG="en_US.ISO-8859-1" ssh username@remotehost.tld
Re: How to change from UTF-8 to ISO-8859?
Yo-hoo! Thanks, that worked for me too. I have been struggling two hours to get the mutt mail reader to handle Norwegian characters on my new laptop. It would show them as ? or \345 etc. in existing emails, and when I tried to send a new email with it, it would not recognize it but would insist it was "unknown-8bit".
Trying to set LANG to UTF-8 was totally useless.
Emacs (which I use for editing email) will still insist on producing UTF-8 so I have to convert that... But that's a problem I've faced before so I had a wrapper script ready. My email setup is a bit complicated already.
BTW I could not find this thread with the forum search but "linux mint" "iso-8859-1" in google had this as the top hit.
I do wonder why one has to go through this just to *enable* ISO-8859-1. Even with UTF-8 the default, it would not be unreasonable for ISO-8859-1 to also work out of the box. In fact, I installed 'xterm' to run mutt in, and that actually sets LANG to en_US.ISO-8859-1. Which does not work...
Trying to set LANG to UTF-8 was totally useless.
Emacs (which I use for editing email) will still insist on producing UTF-8 so I have to convert that... But that's a problem I've faced before so I had a wrapper script ready. My email setup is a bit complicated already.
BTW I could not find this thread with the forum search but "linux mint" "iso-8859-1" in google had this as the top hit.
I do wonder why one has to go through this just to *enable* ISO-8859-1. Even with UTF-8 the default, it would not be unreasonable for ISO-8859-1 to also work out of the box. In fact, I installed 'xterm' to run mutt in, and that actually sets LANG to en_US.ISO-8859-1. Which does not work...