diff options
| author | tholdawa <[email protected]> | 2014-01-16 19:51:51 +0100 |
|---|---|---|
| committer | tholdawa <[email protected]> | 2014-01-16 19:51:51 +0100 |
| commit | 280b2599308a491e12fbbac95d356358cf01abb9 (patch) | |
| tree | a5255e92c0da2269bad1a8e6d38cd20f1c573e22 /examples/example5.cpp | |
| parent | C++11 std::shared_ptr fixes: (diff) | |
| parent | Merge pull request #65 from kisli/tholdawa-master (diff) | |
| download | vmime-280b2599308a491e12fbbac95d356358cf01abb9.tar.gz vmime-280b2599308a491e12fbbac95d356358cf01abb9.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'examples/example5.cpp')
| -rw-r--r-- | examples/example5.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/example5.cpp b/examples/example5.cpp index 159b503c..849ffa75 100644 --- a/examples/example5.cpp +++ b/examples/example5.cpp @@ -32,6 +32,8 @@ // #include <iostream> +#include <locale> +#include <clocale> #include "vmime/vmime.hpp" #include "vmime/platforms/posix/posixHandler.hpp" @@ -41,8 +43,16 @@ int main() { std::cout << std::endl; - // VMime initialization - vmime::platform::setHandler<vmime::platforms::posix::posixHandler>(); + // 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, ""); + } try { |
