Fixed "Slic3r crashes when sending STLs with special characters to the printer"

https://github.com/prusa3d/Slic3r/issues/597
The "Send to OctoPrint" function will now send the file name encoded
in UTF-8, so the file name will not get mangled.

The C++ Slic3r::encode_path() function was returning a string to Perl,
which was marked as UTF-8. This has been fixed, now encode_path() returns
a plain Perl string.

Added path_to_filename, path_to_stem, path_to_extension, path_to_parent_path
Perl wrappers to boost::filesystem::path splitting functionality
to be able to split UTF-8 encoded files on Windows correctly.
This commit is contained in:
bubnikv 2017-12-21 16:56:33 +01:00
parent 1bf67b4b62
commit f5160b7a72
5 changed files with 113 additions and 6 deletions

View file

@ -1,6 +1,7 @@
coordf_t T_NV
std::string T_STD_STRING
local_encoded_string T_STD_STRING_LOCAL_ENCODING
t_config_option_key T_STD_STRING
t_model_material_id T_STD_STRING
@ -279,6 +280,14 @@ T_STD_STRING
$var = std::string(c, len);
}
INPUT
T_STD_STRING_LOCAL_ENCODING
{
size_t len;
const char * c = SvPV($arg, len);
$var = std::string(c, len);
}
T_STD_VECTOR_STD_STRING
if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVAV) {
AV* av = (AV*)SvRV($arg);
@ -438,6 +447,9 @@ OUTPUT
T_STD_STRING
$arg = newSVpvn_utf8( $var.c_str(), $var.length(), true );
T_STD_STRING_LOCAL_ENCODING
$arg = newSVpvn( $var.c_str(), $var.length() );
T_STD_VECTOR_STD_STRING
AV* av = newAV();
$arg = newRV_noinc((SV*)av);