aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/emailAddressTest.cpp
diff options
context:
space:
mode:
authortholdawa <[email protected]>2014-01-16 19:51:51 +0100
committertholdawa <[email protected]>2014-01-16 19:51:51 +0100
commit280b2599308a491e12fbbac95d356358cf01abb9 (patch)
treea5255e92c0da2269bad1a8e6d38cd20f1c573e22 /tests/parser/emailAddressTest.cpp
parentC++11 std::shared_ptr fixes: (diff)
parentMerge pull request #65 from kisli/tholdawa-master (diff)
downloadvmime-280b2599308a491e12fbbac95d356358cf01abb9.tar.gz
vmime-280b2599308a491e12fbbac95d356358cf01abb9.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tests/parser/emailAddressTest.cpp')
-rw-r--r--tests/parser/emailAddressTest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/parser/emailAddressTest.cpp b/tests/parser/emailAddressTest.cpp
index 378cc065..4916aaa9 100644
--- a/tests/parser/emailAddressTest.cpp
+++ b/tests/parser/emailAddressTest.cpp
@@ -25,6 +25,9 @@
#include "vmime/platform.hpp"
+#include <locale>
+#include <clocale>
+
VMIME_TEST_SUITE_BEGIN(emailAddressTest)
@@ -41,6 +44,27 @@ VMIME_TEST_SUITE_BEGIN(emailAddressTest)
VMIME_TEST_LIST_END
+ 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 testParseASCII()
{
vmime::emailAddress eml1("local@domain");