Closed VolkerEnderlein closed 10 years ago
Original comment by Thomas Moeller (Bitbucket: TheHubbit, GitHub: TheHubbit).
Roy, Thank you for commenting on this issue. Yes, I share your concerns regarding changes to the widely used SbString class. Because it is so central I tried to find out what the response of the other users would be. But so far not much objection or support.
I implemented the proposed extension and created pull request #198 for it. I pretty much tried to follow the approach taken so far (even though I'm not a big fan of the style in string.cpp). No new include statements have been added to the header files, which I fear could impact other components possibly even outside of Coin itself, such as SoQt.
Please let me know what you (or maybe others?) think.
Best, Thomas
Original report by Thomas Moeller (Bitbucket: TheHubbit, GitHub: TheHubbit).
Starting with version 4 Coin3D uses UTF8 encoded strings. However, there is no method exposed by the SbString class that encodes a wide character string to UTF8. Also the included utility function cc_string_utf8_encode() only converts single characters and does not handle platform specific encoding of wide character strings (Linux: utf32, Windows: utf16).
In my opinion it would be very useful if the SbString class accepts also wide character strings, taking care of the conversion to UTF8. Please comment on this proposal. Would it be safe to assume that all targeted compilers support the wchar_t type now? I could implement this functionality if there are no concerns.