[wx-dev] RFC: UTF-8 build mode for wx: wxUSE_UNCODE

Vaclav Slavik vslavik at fastmail.fm
Mon Mar 5 03:12:01 PST 2007


Hi,

Vadim Zeitlin wrote:
> VS> The solution would be to add (wxChar*) cast to
> VS> wxCStrData (i.e., only to the native char type, not both char*
> and VS> wchar_t*, so that it's cheap and points to valid data).
> It's not VS> nice, but realistically, it's probably the only thing
> we can do, VS> because const-unsafe C APIs are not entirely
> uncommon.
>
>  I agree but I still wouldn't make this cast implicit. When you do
> something like this, it should really stand out so I'd rather write
> either
>
>         wxstrDesc.c_str().ConstCast()

Making the cast implicit is the whole point. Of course its trivial to 
add a method like ConstCast() and it's better than implicit 
conversion if you ignore backward compatibility. But if you don't 
ignore it, then you have to consider lots of code that _will break_ 
unless the cast is implicit. And it's not only wxMSW implementation, 
but any (user) code that uses the Win32 API directly.

Regards,
Vaclav

-- 
PGP key: 0x465264C9, available from http://pgp.mit.edu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20070305/363c11aa/attachment.pgp


More information about the wx-dev mailing list