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]
# 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]