diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index a42d4389f5..34811f4fc6 100755 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -26,6 +26,7 @@ #include #include "Common/Data/Text/I18n.h" +#include "Common/Data/Encoding/Utf8.h" #include "Common/Thread/ThreadUtil.h" #include "Common/File/FileUtil.h" @@ -541,7 +542,8 @@ void PSPSaveDialog::DisplaySaveDataInfo2(bool showNewData) { s64 sizeK = data_size / 1024; PPGeStyle textStyle = FadedStyle(PPGeAlign::BOX_LEFT, 0.5f); - std::string saveinfoTxt = StringFromFormat("%.128s\n%s %s\n%lld KB", save_title, date_year, hour_time, sizeK); + std::string title = SanitizeUTF8(std::string(save_title, strnlen(save_title, 128))); + std::string saveinfoTxt = StringFromFormat("%s\n%s %s\n%lld KB", title.c_str(), date_year, hour_time, sizeK); PPGeDrawText(saveinfoTxt.c_str(), 8, 200, textStyle); } diff --git a/Core/Util/PPGeDraw.cpp b/Core/Util/PPGeDraw.cpp index da3726ec23..a65608775b 100644 --- a/Core/Util/PPGeDraw.cpp +++ b/Core/Util/PPGeDraw.cpp @@ -955,15 +955,7 @@ static void PPGeDecimateTextImages(int age) { } static std::string PPGeSanitizeText(const std::string &text) { - // Seen in Ratchet & Clank - Secret Agent. To match the output of the real thing, we have to remove - // both the overlong encoding and "ENTR", whatever that is. If we just let SanitizeUTF8 remove - // the overlong null, the rest of the string is missing in the bottom left corner (save size, etc). - // It doesn't seem to be using sceCcc. - // Note how the double "" is required in the middle of the string to end the \x80 constant (otherwise it takes E). - // This behavior doesn't replicate within other games, so it may be a game bug workaround. - std::string str = ReplaceAll(text, "\xC0\x80""ENTR", ""); - // Then SanitizeUTF8 is needed to get rid of various other overlong encodings. - return SanitizeUTF8(str); + return SanitizeUTF8(text); } void PPGeDrawText(const char *text, float x, float y, const PPGeStyle &style) {