From f14d5db9f85c97015394b3082b87a8aa00277fad Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Mon, 18 Mar 2019 22:11:52 -0700 Subject: [PATCH] more --- experiments/iconv/ic5.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/experiments/iconv/ic5.cpp b/experiments/iconv/ic5.cpp index 1df750ad3..1f8a1a021 100644 --- a/experiments/iconv/ic5.cpp +++ b/experiments/iconv/ic5.cpp @@ -6,23 +6,24 @@ using namespace std; // borrowed from DOSLIB #define THIS_IS_JAPANESE "\x82\xb1\x82\xea\x82\xcd\x93\xfa\x96\x7b\x8c\xea\x82\xc5\x82\xb7"/* UTF-8 to Shift-JIS of "これは日本語です" */ -typedef std::basic_string test_string; +typedef uint16_t test_char_t; +typedef std::basic_string test_string; int main() { - _Iconv *x = _Iconv::create(/*FROM*/"SHIFT-JIS"); + _Iconv *x = _Iconv::create(/*FROM*/"SHIFT-JIS"); if (x == NULL) { cerr << "Failed to create context" << endl; return 1; } - _Iconv *fx = _Iconv::create("UTF-8"); + _Iconv *fx = _Iconv::create("UTF-8"); if (fx == NULL) { cerr << "Failed to create context" << endl; return 1; } { - uint16_t tmp[512]; + test_char_t tmp[512]; const char *src = THIS_IS_JAPANESE; x->set_src(src); @@ -63,7 +64,7 @@ int main() { } { - uint16_t tmp[512]; + test_char_t tmp[512]; const char *src = THIS_IS_JAPANESE; x->set_dest(tmp,sizeof(tmp)/sizeof(tmp[0])); @@ -82,7 +83,7 @@ int main() { } { - uint16_t tmp[512]; + test_char_t tmp[512]; const std::string src = THIS_IS_JAPANESE; x->set_dest(tmp,sizeof(tmp)/sizeof(tmp[0]));