by alexrj: Always convert strings to UTF-8 before passing them to XS

This commit is contained in:
bubnikv 2016-10-24 14:08:22 +02:00
parent 250ff451ba
commit 4524ecf66b

View File

@ -271,7 +271,9 @@ INPUT
T_STD_STRING T_STD_STRING
{ {
size_t len; size_t len;
const char * c = SvPV($arg, len); // const char * c = SvPV($arg, len);
// Always convert strings to UTF-8 before passing them to XS
const char * c = SvPVutf8($arg, len);
$var = std::string(c, len); $var = std::string(c, len);
} }