• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Add/Remove Locale Archive in CentOS/RHEL 5,6

by admin

Occasionally the locale archive file(/usr/lib/locale/locale-archive) does not include a locale you want to use. In this case, you need to create a new locale file, or compile the locale from existent one by:

# localedef -f [charmapfile] -i [inputfile] [outputpath]

for example:

# localedef -f SHIFT_JIS -i ja_JP ja_JP.SJIS

The warning message “not ASCII compatible, locale not ISO C compliant” can be ignored. This command can provide appropriate locale even if you get the warning message when running the command above. The message means that “some characters (which are provided by converting ASCII to the locale you mentioned) is not equal to the codes which are converted to UCS-4. For example, ‘\’ and ‘^’ is the typical characters which are UCS-4 in-compatible(‘\’ is 0x00a5 and ‘^’ is 0x203e in UCS-4, although ‘\’ is 0x5c and ‘^’ is 0x7e in ASCII).

You can now use the new locale ja_JP.SJIS. You can check whether the locale is applied to the locale-archive by:

# localedef --list

The listed locale could be lower-case, different from actual locale name. Please note that new locale could change text character processing rule. In this case, you might need to remove the locale from locale-archive by:

# localedef --delete-from-archive [existent_locale_listed_in_localedef--list]

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Fedora, Linux

Some more articles you might also be interested in …

  1. Understanding the rc Scripts in Linux
  2. pvcreate error : Can’t open /dev/sdx exclusively. Mounted filesystem?
  3. How to Install Bless Hex Editor (Hexadecimal Editor) in Ubuntu
  4. tracepath: command not found
  5. at Command Examples in Linux
  6. adig Command Examples in Linux
  7. exec Command Examples in Linux
  8. engrampa Command Examples in Linux
  9. How to use “yum downloadonly” to download a package without installing it
  10. CentOS / RHEL : How to install a specific version of rpm package using YUM

You May Also Like

Primary Sidebar

Recent Posts

  • ncat Command Examples in Linux
  • ncat: command not found
  • nautilus Command Examples in Linux
  • namei: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright