mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: fix saving wrong encoding to 3mf
Change-Id: Icebf770b3dde06216e427744de9377e3f0adda29 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
5194e68ae4
commit
038a04175a
4 changed files with 67 additions and 27 deletions
|
@ -1182,6 +1182,42 @@ std::string xml_escape(std::string text, bool is_marked/* = false*/)
|
|||
return text;
|
||||
}
|
||||
|
||||
std::string xml_unescape(std::string s)
|
||||
{
|
||||
std::string ret;
|
||||
std::string::size_type i = 0;
|
||||
std::string::size_type pos = 0;
|
||||
while (i < s.size()) {
|
||||
std::string rep;
|
||||
if (s[i] == '&') {
|
||||
if (s.substr(i, 4) == "<") {
|
||||
ret += s.substr(pos, i - pos) + "<";
|
||||
i += 4;
|
||||
pos = i;
|
||||
}
|
||||
else if (s.substr(i, 4) == ">") {
|
||||
ret += s.substr(pos, i - pos) + ">";
|
||||
i += 4;
|
||||
pos = i;
|
||||
}
|
||||
else if (s.substr(i, 5) == "&") {
|
||||
ret += s.substr(pos, i - pos) + "&";
|
||||
i += 5;
|
||||
pos = i;
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
ret += s.substr(pos);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string format_memsize_MB(size_t n)
|
||||
{
|
||||
std::string out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue