gnome-terminal locale encoding

Had a problem last week where my editor was defaulting to using UTF-8 whereas the files i was editing were ISO-8859-1. This ISO character set allows for extra single-byte characters beyond those in standard ASCII – including 163 (0xA3), the simple UK ‘£’ sign.

This is nonsense in UTF-8, but my editor cheerfully didn’t inform me that it had made a ‘best guess’ at decoding the character and I ended up saving garbage back out when I wrote the file.

I might have noticed this when I did a diff but I didn’t because gnome-terminal was trying to use UTF-8 so I ended up comparing equally borked decoded characters and didn’t spot it.

Changing my editor’s encoding was simple enough, but changing gnome-terminal wasn’t quite so easy. I could change it for the current session, but had to re-select it each time I opened the terminal, which was far from friendly.

Thankfully this guy had figured it out.

Additionally there is a launchpad request to allow this setting to be changed more easily from within gnome-terminal itself.

Gary Hartley

Gary Hartley is The Floating Frog. A seasoned freelance web designer with skills in UI/UX, CRO design, WordPress, branding, PSD-HTML conversions and more. Got a project you need to start or take to the next level? Please, get in touch!