mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-19 01:10:39 +02:00
Work around bad null decoding (overlong) in Jak & Daxter savedata title.
This commit is contained in:
1 parent
50410d0de3
commit
abff8a078f
2 files changed
+10
No files matched your search
@@ -161,6 +161,13 @@ std::string SanitizeString(std::string_view input, StringRestriction restriction
|
||||
}
|
||||
}
|
||||
|
||||
if (restriction == StringRestriction::NoLineBreaksOrSpecials) {
|
||||
// Additionally, cut off the string if we find an overlong UTF-8 character, such as in Jak & Daxter's title.
|
||||
size_t pos = sanitized.find("\xc0\x80");
|
||||
if (pos != (size_t)std::string::npos) {
|
||||
sanitized.resize(pos);
|
||||
}
|
||||
}
|
||||
return sanitized;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user