wxMSW DrawText and SetUserScale

Martin Cote cote.martin at gmail.com
Sat Apr 12 20:36:05 PDT 2008


On Sat, Apr 12, 2008 at 8:59 PM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
>
>   Sorry, I don't understand how can \130 (is this in octal? hexadecimal?)
>  correspond to "é" which is 233 (== 0xe9 == 0351) in ISO-8859-1. So it's
>  hard to say whether the behavior is normal without knowing what exactly do
>  you pass to DrawText(). If you pass it decimal 130 I think it's normal that
>  it doesn't draw "é".

Sorry for the confusion.  I'll try to explain myself better.  If I'm
saving a wxString (with wxMSW) that contains the letter 'É', the
sequence \311 is written in the file (the octal value of 'É'). The
file is read back by wxMSW properly though, so this isn't really a
problem.

Note that I'm saving the wxString using a std::wofstream.  I was able
to stream a wxString without doing anything special with wxMSW, but
I'm having the behavior described earlier.  With wxMac, I had to
provide my own stream operator for wxString like this:

std::wostream &
operator<<( std::wostream & out , wxString const & string )
{
    return out << static_cast< wchar_t const * >( string.c_str() ) ;
}

When saved this way, unicode characters appears properly in the file.

Is this something that anybody else has run into?  Having to provide
my own stream operator doesn't seem right.  Seeing octal escape
sequences in the file doesn't seem right either.  It's nothing major,
but I would like to know if I'm doing anything wrong.

Thanks for your time,
Martin Cote


More information about the wx-users mailing list