mirror of https://github.com/KLayout/klayout.git
Using C.UTF-8 locale fallback for string tests for vanilla Linux installations.
This commit is contained in:
parent
3dd55bdd2a
commit
aca209c095
|
|
@ -484,9 +484,13 @@ TEST(14)
|
||||||
// UTF-8 to wchar_t and local conversion
|
// UTF-8 to wchar_t and local conversion
|
||||||
TEST(15)
|
TEST(15)
|
||||||
{
|
{
|
||||||
// NOTE: we don't know the local setting, but translation back and forth should work.
|
|
||||||
std::string locale = setlocale (LC_ALL, NULL);
|
std::string locale = setlocale (LC_ALL, NULL);
|
||||||
setlocale (LC_ALL, "en_US.UTF-8");
|
const char *lc = setlocale (LC_ALL, "en_US.UTF-8");
|
||||||
|
if (! lc || std::string (lc) != "en_US.UTF-8") {
|
||||||
|
// use C.UTF-8 as fallback
|
||||||
|
setlocale (LC_ALL, "C.UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
EXPECT_EQ (tl::to_string_from_local (tl::to_local ("Hällo\tWörld!").c_str ()), "Hällo\tWörld!");
|
EXPECT_EQ (tl::to_string_from_local (tl::to_local ("Hällo\tWörld!").c_str ()), "Hällo\tWörld!");
|
||||||
setlocale (LC_ALL, locale.c_str ());
|
setlocale (LC_ALL, locale.c_str ());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue