summaryrefslogtreecommitdiff
path: root/cpp/test/IceUtil/unicode/Client.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-01-17 18:53:26 +0000
committerMarc Laukien <marc@zeroc.com>2002-01-17 18:53:26 +0000
commitee96d66cf2a5a5b62b5ac01dbe251ba21e7fae96 (patch)
tree20e6b7d2611345407074be079cdb9f6f6cb64904 /cpp/test/IceUtil/unicode/Client.cpp
parentFix bug with location of annotation for some types. (diff)
downloadice-ee96d66cf2a5a5b62b5ac01dbe251ba21e7fae96.tar.bz2
ice-ee96d66cf2a5a5b62b5ac01dbe251ba21e7fae96.tar.xz
ice-ee96d66cf2a5a5b62b5ac01dbe251ba21e7fae96.zip
unicode tests
Diffstat (limited to 'cpp/test/IceUtil/unicode/Client.cpp')
-rw-r--r--cpp/test/IceUtil/unicode/Client.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp
new file mode 100644
index 00000000000..2d978284191
--- /dev/null
+++ b/cpp/test/IceUtil/unicode/Client.cpp
@@ -0,0 +1,43 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <IceUtil/Unicode.h>
+#include <TestCommon.h>
+
+using namespace IceUtil;
+using namespace std;
+
+int
+main(int, char**)
+{
+ cout << "testing string/wstring conversion... ";
+
+ string arabic = "لماذا لا يتكلمون اللّغة العربية فحسب؟";
+
+ wstring warabic = stringToWstring(arabic);
+ test(warabic.length() == 37);
+
+ string arabic2 = wstringToString(warabic);
+ test(arabic2.length() == arabic.length());
+ test(arabic2 == arabic);
+
+ string japanese = "なぜ、みんな日本語を話してくれないのか?";
+
+ wstring wjapanese = stringToWstring(japanese);
+ test(wjapanese.length() == 20);
+
+ string japanese2 = wstringToString(wjapanese);
+ test(japanese2.length() == japanese.length());
+ test(japanese2 == japanese);
+
+ cout << "ok" << endl;
+
+ return EXIT_SUCCESS;
+}