0

As an American I have the obvious choices of en.UTF-8 or ISO-8859-1 encodings for the locale setting.

Most guides recommend using the UTF-8 encoding, but I am a little nervous that it is a multibyte encoding. What are the consequences of using this? Will some text files have those annoying character sequences t h a t l o o k l i k e t h i s ? What are the plusses and minuses of the two choices?

For example, let's say I use a browser in a graphical window manager. Will the browser be unable to display UTF-8 characters because I chose ISO-8859-1 as my locale?

2

Locale specifies:

  1. Which characters your terminal is able to receive and output
  2. Which characters your terminal applications are able to receive and output
  3. The language of your applications

It's unlikely to affect your graphical applications.

The example you've provided is the UTF-16 encoding whose minimum unit of data is 16 bits/2 bytes. It's the default encoding for many Windows applications but it's not supported on Linux aside from some utilities, e.g. iconv.

I highly recommend not switching to C/ISO-8859-1 because

  1. You'll have troubles working with any text not covered by ASCII
  2. You'll have troubles displaying any characters in console not covered by ASCII

Lastly UTF-8 is a multibyte encoding only for symbols not covered by ASCII. ASCII text can be considered UTF-8.

Also check this answer: What is the difference between UTF-8 and ISO-8859-1?

4
  • I think OP's example is more likely to be that look like this i.e., full-width characters which can be UTF-8 just fine. – muru Dec 1 '20 at 9:58
  • @muru "Will some text files have those annoying character sequences" - he's definitely from the Windows world. – Artem S. Tashkinov Dec 1 '20 at 10:04
  • I agree (I don't think anybody else would even be thinking of ISO-8859-1), I'm just noting that full-width characters don't have to be UTF-16 – muru Dec 1 '20 at 10:09
  • Yeah, that's true. – Artem S. Tashkinov Dec 1 '20 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.