[Cppunit-devel] Unicode
Brought to you by:
blep
From: Baptiste L. <bl...@cl...> - 2001-05-18 21:23:52
|
Michael Arnoldus gracefuly sent me a unicode version of CppUnitW 1.2. The change required to add unicode support in cppunit are: * having alias to std::string or std::wstring depending on weither we are compiling for unicode or not. This also apply to ostrstream, cerr, and cout. Michael did it that as follow: #ifdef _UNICODE #define _tstring wstring #else #define _tstring string #endif This could probably be done using typedef and creating string in CppUnit namespace too: #ifdef _UNICODE typedef std::wstring string #else typedef std::string string #endif * having a macro _T which make the specified string unicode when needed: std::_tstring( _T( "Unknown" ) ) * adding a function ustring( const char *) to estring.h to construct a unicode string from a const char *string. This one is a problem for portability. Mapping from "char *" to unicode is done using WIN32 API. So how is that done on unix. Is there a single API for all Unix to do the mapping ? (I know that QT support unicode and is portable, but not how difficult it is to achieve on Unix) * adding new configuration to projects setting for VC++ (Michael let me know if I forgot something) Note for Unix developper: The _t thingy is a win32 idiom. We have a tchar.h header which provides all string function with such a prefix, aliasing to either single byte character string or unicode character string function depending on _UNICODE symbol. Is there such an idiom for Unix ? Here is the "Unicode TODO" list that I can see for now: - make a new header file which contains all stuffs relating to unicode (macros, typedef...) - replace character dependent object used in cppunit with those defined in the previous header - add the ustring function. I'm can do all those stuffs but we need to define the specific (header file name, define/typedef, alias name, _T name...). Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |