[wx-dev] Re: #9672: wx 2.9 Ansi/Unicode Combi-wxString breaks
compatibility
Vadim Zeitlin
vadim at wxwidgets.org
Thu Jul 3 06:51:17 PDT 2008
On Thu, 03 Jul 2008 15:26:04 +0200 Robert Roebling wrote:
RR> c)
RR> By changing the return value of c_str() from const wchar_t* to
RR> const wchar_t* or const char* people like Hajo, who wrote perfectly
RR> well behaving Unicode apps have to go through their sources
RR> instead of people using ANSI. We are in effect punishing people
RR> for using wxWidgets in Unicode mode, which we always recommended.
We don't punish them but we do consider that people who used Unicode before
are more likely to fix their code correctly than those who didn't. And yes,
this was a conscious design decision from the very beginning, please see
the wiki page: if it was impossible to preserve compatibility with both
ANSI and Unicode build we consistently chose to preserve compatibility with
ANSI one. And I absolutely stand by this because I believe that we need to
help the novice users first, more advanced users are less likely to run
into problems.
RR> d)
RR> When comparing wxString to std::string, it is clearly more like
RR> std::wstring as it holds a Unicode string and therefore wxString's
RR> c_str() should also behave like std::wstring::c_str(). At least
RR> one could argue like this.
One could argue like anything at all but again, this is not what was
decided (without any objections from anyone AFAIR) a year ago when we
started changing this. And you can't change c_str() without changing all
the other places where we preferred keeping compatibility with ANSI instead
of Unicode.
Regards,
VZ
More information about the wx-dev
mailing list