mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
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:
parent
1bf67b4b62
commit
f5160b7a72
5 changed files with 113 additions and 6 deletions
|
@ -91,7 +91,7 @@ data_dir()
|
|||
RETVAL = const_cast<char*>(Slic3r::data_dir().c_str());
|
||||
OUTPUT: RETVAL
|
||||
|
||||
std::string
|
||||
local_encoded_string
|
||||
encode_path(src)
|
||||
const char *src;
|
||||
CODE:
|
||||
|
@ -112,6 +112,34 @@ normalize_utf8_nfc(src)
|
|||
RETVAL = Slic3r::normalize_utf8_nfc(src);
|
||||
OUTPUT: RETVAL
|
||||
|
||||
std::string
|
||||
path_to_filename(src)
|
||||
const char *src;
|
||||
CODE:
|
||||
RETVAL = Slic3r::PerlUtils::path_to_filename(src);
|
||||
OUTPUT: RETVAL
|
||||
|
||||
std::string
|
||||
path_to_stem(src)
|
||||
const char *src;
|
||||
CODE:
|
||||
RETVAL = Slic3r::PerlUtils::path_to_stem(src);
|
||||
OUTPUT: RETVAL
|
||||
|
||||
std::string
|
||||
path_to_extension(src)
|
||||
const char *src;
|
||||
CODE:
|
||||
RETVAL = Slic3r::PerlUtils::path_to_extension(src);
|
||||
OUTPUT: RETVAL
|
||||
|
||||
std::string
|
||||
path_to_parent_path(src)
|
||||
const char *src;
|
||||
CODE:
|
||||
RETVAL = Slic3r::PerlUtils::path_to_parent_path(src);
|
||||
OUTPUT: RETVAL
|
||||
|
||||
void
|
||||
xspp_test_croak_hangs_on_strawberry()
|
||||
CODE:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue