Menu

#81 Fix string conversion to platform string

Version 2.0
open
None
8
2017-08-13
2017-08-13
No

When a carl::String needs to be presented to a host OS API service (to open a file, to set a window's tittle, etc.) it is converted from ISO10646 to a wchar_t (windows) or char (linux) string. Currenmtly, the conversion just chops off the high bits of every character.

What should be happening is a proper character set conversion; specifically:
* on Windows, ISO10646 should be converted to a wchar_t string using surrogate pairs if necessary.
* on Unix, ISO10646 should be converted to a char string using UTF-8.

The carl::String::_store() internal methods are used throughout the code base for the purpose, so re-implement them to do the trick.

Discussion