[Opentrep-svn] SF.net SVN: opentrep:[205] trunk/opentrep/test/i18n
Status: Beta
Brought to you by:
denis_arnaud
From: <den...@us...> - 2009-11-11 21:02:55
|
Revision: 205 http://opentrep.svn.sourceforge.net/opentrep/?rev=205&view=rev Author: denis_arnaud Date: 2009-11-11 21:02:44 +0000 (Wed, 11 Nov 2009) Log Message: ----------- [Test] Added a few literal (UTF-8) string tests. Modified Paths: -------------- trunk/opentrep/test/i18n/icu/icuustring.cpp trunk/opentrep/test/i18n/utf8/utf8.cpp Added Paths: ----------- trunk/opentrep/test/i18n/utf8/pyutf8.py Modified: trunk/opentrep/test/i18n/icu/icuustring.cpp =================================================================== --- trunk/opentrep/test/i18n/icu/icuustring.cpp 2009-11-02 14:43:52 UTC (rev 204) +++ trunk/opentrep/test/i18n/icu/icuustring.cpp 2009-11-11 21:02:44 UTC (rev 205) @@ -97,16 +97,19 @@ // extract() overload that takes a UConverter argument. // cnv = ucnv_open(NULL, &errorCode); cnv = ucnv_open("UTF-8", &errorCode); - if(U_FAILURE(errorCode)) { - fprintf(stderr, "error %s opening the default converter\n", u_errorName(errorCode)); - return errorCode; + if (U_FAILURE(errorCode)) { + fprintf (stderr, "error %s opening the default converter\n", + u_errorName(errorCode)); + return errorCode; } - ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, NULL, NULL, &errorCode); - if(U_FAILURE(errorCode)) { - fprintf(stderr, "error %s setting the escape callback in the default converter\n", u_errorName(errorCode)); - ucnv_close(cnv); - return errorCode; + ucnv_setFromUCallBack (cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, + NULL, NULL, &errorCode); + if (U_FAILURE(errorCode)) { + fprintf (stderr, "error %s setting the escape callback in the default converter\n", + u_errorName(errorCode)); + ucnv_close(cnv); + return errorCode; } demoCaseMapInCPlusPlus(); Added: trunk/opentrep/test/i18n/utf8/pyutf8.py =================================================================== --- trunk/opentrep/test/i18n/utf8/pyutf8.py (rev 0) +++ trunk/opentrep/test/i18n/utf8/pyutf8.py 2009-11-11 21:02:44 UTC (rev 205) @@ -0,0 +1,10 @@ +#!/usr/bin/python + +charList = [ '\xd9', '\x83', '\xd8', '\xa7', '\xd9', '\x81', '\x20', '\xd8', + '\xa7', '\xd9', '\x84', '\xd8', '\xac', '\xd8', '\xa7', '\xd8', + '\xb9', '\x00' ] + +location = '' +location = ''.join(charList) + +print location Property changes on: trunk/opentrep/test/i18n/utf8/pyutf8.py ___________________________________________________________________ Added: svn:executable + * Modified: trunk/opentrep/test/i18n/utf8/utf8.cpp =================================================================== --- trunk/opentrep/test/i18n/utf8/utf8.cpp 2009-11-02 14:43:52 UTC (rev 204) +++ trunk/opentrep/test/i18n/utf8/utf8.cpp 2009-11-11 21:02:44 UTC (rev 205) @@ -15,6 +15,7 @@ #include <cstdio> #include <cstring> #include <cstdarg> +#include <iostream> #ifdef WIN32 #include <malloc.h> #else @@ -478,6 +479,12 @@ // ////////////////// M A I N /////////////////// int main (int argc, char* argv[]) { + + const char query2[] = { 0xd9, 0x83, 0xd8, 0xa7, 0xd9, 0x81, ' ', 0xd8, + 0xa7, 0xd9, 0x84, 0xd8, 0xac, 0xd8, 0xa7, 0xd8, + 0xb9, 0 }; + std::cout << "String: '" << query2 << "'" << std::endl; + return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |