Mark Dootson <mark.doot...@znix.com> writes:

> #define WXSTRING_INPUT( var, type, arg ) \
>   var =  ( SvUTF8( arg ) ) ? \
>            wxString( SvPVutf8_nolen( arg ), wxConvUTF8 ) \
>          : wxString( SvPV_nolen( arg ), wxConvLibc );
>
> So basically, if the scalar is marked as 'utf8' then it gets converted
> into a wxString as such. If not, you're at the mercy of libc and local
> system settings. It may work. It may not.
>
> Solution - your conversion of external data should be
>
>  my $string = decode($encoding, $binary);
>  utf8::upgrade($string);

I'd say this is the wrong approach. The solution is to adjust the
WXSTRING_PUT macro to check for the utf8 flag and handle accordingly.

-- Johan

Reply via email to