OpenAccess Internationalization with Unicode oaString
John McGehee, Voom, Inc. http://www.voom.net
December 16, 2010
This contributed code extends the oaString class to support Unicode UTF-8,
which can represent virtually every written language in history. A much more
thorough oaString unit test is included.
This code matches OpenAccess version oa-22.04p028.
See http://www.voom.net/internationalization-oastring for a complete explanation.
If you send me the .dox file, I will document these functions and send it back
Naturally I am hoping that this code will be integrated into a future version
Beyond adding Unicode UTF-8 support, I also fixed the following bugs and
enhancementsi and provided unit tests:
Implemented in */oaString*:
Bug 1280 oaString::substr() and oaString::index() do not check for out-of-range
Bug 1283 oaString::resize() allows size 0, does not terminate truncated strings
Bug 1284 oaString::operator() does not check for out-of-range offset
Enh 1190 Add oaString::c_str()
Implemented in */oaFont*:
Bug 1285 oaFont::calcBBox() does not check for out-of-range character value
Implemented in */oaNameSpace*:
Bug 1286 Using characters greater than 127 causes asserts and other problems
All of the above together satisfies this feature request:
Enh 700 Please add wide strings for Asian characters
I have uploaded a hierarchy of source code files. Install it in your OpenAccess
source like this:
# Download oaStringUTF8-12-16-10.tgz
# Back up /path/to/OpenAccess
tar xvfz oaStringUTF8-12-16-10.tgz
Add the "OPTMODE=dbg" option to the above make commands if you want to build
and test the debug version.