diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 1607319c587..c52f280a317 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -980,8 +980,8 @@ static DetectedGames getGameList(const Common::FSNode &dir) { DetectionResults detectionResults = EngineMan.detectGames(files); if (detectionResults.foundUnknownGames()) { - Common::String report = detectionResults.generateUnknownGameReport(false, 80); - g_system->logMessage(LogMessageType::kInfo, report.c_str()); + Common::U32String report = detectionResults.generateUnknownGameReport(false, 80); + g_system->logMessage(LogMessageType::kInfo, report.encode().c_str()); } return detectionResults.listRecognizedGames(); diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 481a78f838c..6abb8325703 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -544,8 +544,8 @@ bool LauncherDialog::doGameDetection(const Common::String &path) { DetectionResults detectionResults = EngineMan.detectGames(files); if (detectionResults.foundUnknownGames()) { - Common::String report = detectionResults.generateUnknownGameReport(false, 80); - g_system->logMessage(LogMessageType::kInfo, report.c_str()); + Common::U32String report = detectionResults.generateUnknownGameReport(false, 80); + g_system->logMessage(LogMessageType::kInfo, report.encode().c_str()); } Common::Array candidates = detectionResults.listDetectedGames(); diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 956f5f24a63..e3ade58e95c 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -187,8 +187,8 @@ void MassAddDialog::handleTickle() { DetectionResults detectionResults = EngineMan.detectGames(files); if (detectionResults.foundUnknownGames()) { - Common::String report = detectionResults.generateUnknownGameReport(false, 80); - g_system->logMessage(LogMessageType::kInfo, report.c_str()); + Common::U32String report = detectionResults.generateUnknownGameReport(false, 80); + g_system->logMessage(LogMessageType::kInfo, report.encode().c_str()); } // Just add all detected games / game variants. If we get more than one, diff --git a/gui/unknown-game-dialog.cpp b/gui/unknown-game-dialog.cpp index ec434820b64..3e2b8e9265c 100644 --- a/gui/unknown-game-dialog.cpp +++ b/gui/unknown-game-dialog.cpp @@ -119,8 +119,8 @@ void UnknownGameDialog::rebuild() { } } -Common::String UnknownGameDialog::encodeUrlString(const Common::String &string) { - Common::String encoded; +Common::U32String UnknownGameDialog::encodeUrlString(const Common::U32String &string) { + Common::U32String encoded; for (uint i = 0 ; i < string.size() ; ++i) { char c = string[i]; if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || @@ -132,24 +132,27 @@ Common::String UnknownGameDialog::encodeUrlString(const Common::String &string) return encoded; } -Common::String UnknownGameDialog::generateBugtrackerURL() { - Common::String report = generateUnknownGameReport(_detectedGame, false, false); +Common::U32String UnknownGameDialog::generateBugtrackerURL() { + Common::U32String report = generateUnknownGameReport(_detectedGame, false, false); report = encodeUrlString(report); Common::String engineId = encodeUrlString(_detectedGame.engineId); - return Common::String::format( + Common::String preFinalReport = Common::String::format( "https://www.scummvm.org/unknowngame?" - "engine=%s" - "&description=%s", - engineId.c_str(), - report.c_str()); + "engine=%s", + engineId.c_str()); + + Common::U32String repDesc("&description="); + repDesc += report; + + return Common::U32String(preFinalReport) + repDesc; } void UnknownGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch(cmd) { case kCopyToClipboard: { - Common::String report = generateUnknownGameReport(_detectedGame, false, false); + Common::U32String report = generateUnknownGameReport(_detectedGame, false, false); if (g_system->setTextInClipboard(report)) { g_system->displayMessageOnOSD( diff --git a/gui/unknown-game-dialog.h b/gui/unknown-game-dialog.h index 24e4179bf48..7f9e99bd5bd 100644 --- a/gui/unknown-game-dialog.h +++ b/gui/unknown-game-dialog.h @@ -45,8 +45,8 @@ private: void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override; void reflowLayout() override; - Common::String generateBugtrackerURL(); - static Common::String encodeUrlString(const Common::String &string); + Common::U32String generateBugtrackerURL(); + static Common::U32String encodeUrlString(const Common::U32String &string); const DetectedGame &_detectedGame; ScrollContainerWidget *_textContainer;