From 4524ecf66bdc45722257e7179ee38fe57feedfb6 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 24 Oct 2016 14:08:22 +0200 Subject: [PATCH] by alexrj: Always convert strings to UTF-8 before passing them to XS --- xs/xsp/my.map | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xs/xsp/my.map b/xs/xsp/my.map index 7fb501542..0234bb3fa 100644 --- a/xs/xsp/my.map +++ b/xs/xsp/my.map @@ -271,7 +271,9 @@ INPUT T_STD_STRING { 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); }