I need the cs_CZ.ISO8859-2 locale to exist on Ubuntu 12.04 so a specific unit test can pass. The test makes the following call:
std::locale("cs_CZ.ISO8859-2")
On my OS X Lion install, this locale does exist, so the call to std::locale should work:
$ locale -a | grep cs
cs_CZ
cs_CZ.ISO8859-2
cs_CZ.UTF-8
$
However, on my Ubuntu 12.04 install, there is only a UTF8 variant, and no ISO8859-2 version of the cs_CZ locale, despite having installed language-pack-cs
:
$ dpkg -l | grep language-pack-cs
ii language-pack-cs 1:12.04+20120417 translation updates for language Czech
ii language-pack-cs-base 1:12.04+20120417 translations for language Czech
$ locale -a | grep cs_
cs_CZ.utf8
$
The unit test fails on this machine. Running the unit test under strace shows that it really is looking for the ISO8859-2 variant and not finding it anywhere:
open("/usr/lib/locale/cs_CZ.ISO8859-2/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/cs_CZ.iso88592/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/cs_CZ/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/cs.ISO8859-2/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/cs.iso88592/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/cs/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs_CZ.ISO8859-2/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs_CZ.iso88592/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs_CZ/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs.ISO8859-2/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs.iso88592/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/cs/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
I know absolutely nothing about locales, i18n, etc. However, I would like to get this test passing, and changing the test is not an option. If anyone can offer any insight into how to make this locale exist on Ubuntu 12.04 I would appreciate it greatly.