aboutsummaryrefslogtreecommitdiffstats
path: root/tests/icutest.cpp
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-08-14 09:57:17 +0000
committerdanglassey <danglassey>2002-08-14 09:57:17 +0000
commitdaa67ff1f728c07f2a116ee9a9f4505479ca6808 (patch)
treec224a537d30480002ae0560cc9104b543b4d1b5e /tests/icutest.cpp
parent6d6973e035aac5ec1676efccd5b8ada70c40b639 (diff)
downloadsword-sf-cvs-daa67ff1f728c07f2a116ee9a9f4505479ca6808.tar.gz
Initial import from crosswire CVS for syncingimport-1.1.1
Diffstat (limited to 'tests/icutest.cpp')
-rw-r--r--tests/icutest.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/icutest.cpp b/tests/icutest.cpp
new file mode 100644
index 0000000..fa3cf3d
--- /dev/null
+++ b/tests/icutest.cpp
@@ -0,0 +1,34 @@
+#include <iostream>
+#include <string>
+
+#include "unicode/utypes.h" /* Basic ICU data types */
+#include "unicode/ucnv.h" /* C Converter API */
+#include "unicode/convert.h" /* C++ Converter API */
+#include "unicode/ustring.h" /* some more string fcns*/
+
+#include "unicode/translit.h"
+
+int main() {
+
+ UChar * uBuf;
+ UChar * target;
+ UConverter *conv;
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t uBufSize = 0, uLength = 0;
+
+ char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
+
+ uLength = strlen(samplestring);
+ conv = ucnv_open("utf-8", &status);
+ uBufSize = (uLength/ucnv_getMinCharSize(conv));
+ uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+
+ target = uBuf;
+
+ ucnv_toUChars(conv, target, uLength,
+ samplestring, uLength, &status);
+
+ cout << samplestring << endl;
+
+ return 0;
+}