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 cscs_CZcs_CZ.ISO8859-2cs_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-csii  language-pack-cs                       1:12.04+20120417                        translation updates for language Czechii  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.
How do I install the cs_CZ.ISO8859-2 locale on Ubuntu 12.04
ubuntu;locale;unicode
The steps below work on Arch Linux (not sure about Ubuntu).Edit file /etc/locale.gen,add line cs_CZ ISO-8859-2,run sudo locale-gen to generate locale files.After that std::locale(cs_CZ.ISO8859-2) should work fine.