diff options
Diffstat (limited to 'tests/parser/parameterTest.cpp')
-rw-r--r-- | tests/parser/parameterTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/parser/parameterTest.cpp b/tests/parser/parameterTest.cpp index 3b0edebf..4f6f8677 100644 --- a/tests/parser/parameterTest.cpp +++ b/tests/parser/parameterTest.cpp @@ -23,6 +23,9 @@ #include "tests/testUtils.hpp" +#include <locale> +#include <clocale> + VMIME_TEST_SUITE_BEGIN(parameterTest) @@ -62,6 +65,27 @@ VMIME_TEST_SUITE_BEGIN(parameterTest) (p.getParameterAt(n)->getValue().getBuffer()) + void setUp() + { + // Set the global C and C++ locale to the user-configured locale. + // The locale should use UTF-8 encoding for these tests to run successfully. + try + { + std::locale::global(std::locale("")); + } + catch (std::exception &) + { + std::setlocale(LC_ALL, ""); + } + } + + void tearDown() + { + // Restore default locale + std::locale::global(std::locale("C")); + } + + void testParse() { // Simple parameter |