[wx-dev] Improving wxString proposal (Re: #9672: wx 2.9
Ansi/Unicode Combi-wxString)
Robert Roebling
robert at roebling.de
Fri Jul 11 01:12:58 PDT 2008
Jeff Tupper wrote:
> How does making the default encoding for wxStrings utf-8 address
> this? Is the goal to get users to abandon already existing wx
> projects that are made unusable by this change? Or is the goal
> to get developers to rewrite their string algorithms in affected
> projects?
It has been hoped for that the vast majority of users would
not have to rewrite string algorithms and the remaining
would indeed have to adapt them.
> If you are trying to push a single standard, pushing wchar_t
> would seem a more obvious choice as it seems far less likely
> that wchar_t will cause wx applications to become unusable
> (than utf-8).
I understand that as a vote to make the wchar_t build the
default and leave the UTF-8 build as an option for those
who want it.
Did I mention that we can also consider to have a UTF-16 build
for all platforms, UTF-16 being the standard on Windows
anyway, being used by other noteworthy cross-platform projects,
offering a decent mix of performance vs. memory usage, finally
bringing the exact same semantics to all platforms (not the case
when just using wchar_t). From reading the documentation of
the CoreFoundation string class I also seem to understand it
is using UTF-16, at least it uses the 16-bit UniChar in several
places.
Unless I'm mistaken, we'd just define a wxChar16 (or whatever
you name it, to be replaced by a future wchar16_t) and use
std::basic_string<wxChar16> to store the data. Sure, we'd
still have conversion to/from UTF-8 under Linux, but I don't
have the impression that anyone apart from Vaclav and Vadim
have any problems with that.
Robert
More information about the wx-dev
mailing list