Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There are some questions about Linux locale confused me much.

What is the difference between zh_CN.utf8 and zh_CN.UTF-8 ?

Are they the same locale ?

Run locale command:

LANG=zh_CN.UTF-8  
LANGUAGE=  
LC_CTYPE="zh_CN.UTF-8"  
LC_NUMERIC=zh_CN.UTF-8  
LC_TIME=zh_CN.UTF-8  

Run locale -a command:

C  
C.UTF-8  
en_AG  
en_AG.utf8  
POSIX  
zh_CN.gbk  
zh_CN.utf8  
POSIX  

Anther two question:

What is the difference between C and C.UTF-8 ?
What is the difference between en_AG and en_AG.UTF-8 ?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

The file /usr/share/i18n/SUPPORTED lists locales that are supported in Ubuntu with their correct names along with encoding.

  • zh_CN.UTF-8 is the correct name, and zh_CN.utf8 is an alias that refers to the same locale.
  • C, unlike C.UTF-8, enables usascii encoding.
  • en_AG is the correct name, even if en_AG.UTF-8 is a working locale name that refers to the same locale.
share|improve this answer
    
In file /usr/share/i18n/SUPPORTED, I see the following two lines: - en_US.UTF-8 UTF-8 - en_US ISO-8859-1 Does it means that locale en_US uses ISO-8859-1 encoding and en_US.UTF-8 uses UTF-8 encoding? May I use en_US.ISO-8859-1 as the alias of en_US? <br/> And the most important one, how does Ubuntu determine the real locale from the alias? –  sfz Dec 19 '13 at 14:14
    
1: Yes; 2: Don't know; 3: Don't know - Please don't ask new questions in comments. –  Gunnar Hjalmarsson Dec 19 '13 at 14:19

What is the difference between en_AG and en_AG.UTF-8 ?

en_AGNot having character encoding facility , so it must look up when encoding needed. but en_AG.UTF-8 have character encoding , so it will take care of encoded characters when it needs to do.

share|improve this answer
    
Not correct. en_AG is the correct name of the English language locale for Antigua and Barbuda, and it enables UTF-8 encoding. –  Gunnar Hjalmarsson Dec 19 '13 at 13:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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