summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/stringConverter/Client.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-07-18 16:47:05 -0400
committerBernard Normier <bernard@zeroc.com>2007-07-18 16:47:05 -0400
commitd7677e935d836ce91e64af89e78d0c0345a49b7d (patch)
tree51a19a78005a291fd81997ee5e9114edf1b67a12 /cpp/test/Ice/stringConverter/Client.cpp
parentMerge branch 'master' of ssh://cvs/home/git/ice (diff)
downloadice-d7677e935d836ce91e64af89e78d0c0345a49b7d.tar.bz2
ice-d7677e935d836ce91e64af89e78d0c0345a49b7d.tar.xz
ice-d7677e935d836ce91e64af89e78d0c0345a49b7d.zip
Added new WindowsStringConverter
Diffstat (limited to 'cpp/test/Ice/stringConverter/Client.cpp')
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp
index 795535d6ece..8186e64151e 100644
--- a/cpp/test/Ice/stringConverter/Client.cpp
+++ b/cpp/test/Ice/stringConverter/Client.cpp
@@ -10,7 +10,14 @@
#include <Ice/Ice.h>
#include <TestCommon.h>
#include <Test.h>
+
+#if defined(ICONV_ON_WINDOWS)
+//
+// On Windows, Ice/IcongStringConverter.h is not included by Ice/Ice.h
+//
#include <Ice/IconvStringConverter.h>
+#endif
+
#include <iostream>
#include <locale.h>
@@ -49,26 +56,34 @@ public:
};
static bool useLocale = false;
+static bool useIconv = true;
int
main(int argc, char* argv[])
{
Client app;
+#ifndef _WIN32
//
// Switch to French locale
// (we just used the codeset for as default internal code for
// initData.stringConverter below)
//
-
-#ifndef _WIN32
+
useLocale = (setlocale(LC_ALL, "fr_FR.ISO8859-15") != 0
|| setlocale(LC_ALL, "fr_FR.iso885915@euro") != 0);
#endif
Ice::InitializationData initData;
-#if defined(__hpux)
+#if defined(_WIN32) && !defined(ICONV_ON_WINDOWS)
+ //
+ // 28605 == ISO 8859-15 codepage
+ //
+ initData.stringConverter = new Ice::WindowsStringConverter(28605);
+ useIconv = false;
+
+#elif defined(__hpux)
if(useLocale)
{
initData.stringConverter = new Ice::IconvStringConverter<char>;
@@ -132,11 +147,15 @@ Client::run(int, char*[])
char oe = char(0xBD); // A single character in ISO Latin 9
string msg = string("tu me fends le c") + oe + "ur!";
- cout << "testing iconv string converter";
+ cout << "testing string converter";
if(useLocale)
{
cout << " (using locale)";
}
+ if(useIconv)
+ {
+ cout << " (using iconv)";
+ }
cout << "..." << flush;
wstring wmsg = clientPrx->widen(msg);
test(clientPrx->narrow(wmsg) == msg);