diff options
author | Thierry Crozat | 2019-09-19 00:16:24 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-09-21 22:15:26 +0300 |
commit | caf096807895d30983c649e4218033fa3abccbfa (patch) | |
tree | e030f70fe98f7d0a7cac420f7587d19781f8dbdb /backends/networking/sdl_net/uploadfileclienthandler.cpp | |
parent | c38600410e7ea5cf0bbb4edf11ccafa49f332f05 (diff) | |
download | scummvm-rg350-caf096807895d30983c649e4218033fa3abccbfa.tar.gz scummvm-rg350-caf096807895d30983c649e4218033fa3abccbfa.tar.bz2 scummvm-rg350-caf096807895d30983c649e4218033fa3abccbfa.zip |
NETWORKING: Convert translation results to UTF-8 for local webserver pages
Diffstat (limited to 'backends/networking/sdl_net/uploadfileclienthandler.cpp')
-rw-r--r-- | backends/networking/sdl_net/uploadfileclienthandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backends/networking/sdl_net/uploadfileclienthandler.cpp b/backends/networking/sdl_net/uploadfileclienthandler.cpp index 8486b6e92e..fb00b6bf5e 100644 --- a/backends/networking/sdl_net/uploadfileclienthandler.cpp +++ b/backends/networking/sdl_net/uploadfileclienthandler.cpp @@ -66,7 +66,7 @@ void UploadFileClientHandler::handle(Client *client) { // fail on suspicious headers if (_headersStream->size() > Reader::SUSPICIOUS_HEADERS_SIZE) { - setErrorMessageHandler(*client, _("Invalid request: headers are too long!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid request: headers are too long!"))); } break; @@ -108,7 +108,7 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { // fail on suspicious headers if (_headersStream->size() > Reader::SUSPICIOUS_HEADERS_SIZE) { - setErrorMessageHandler(*client, _("Invalid request: headers are too long!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid request: headers are too long!"))); } // search for "upload_file" field @@ -134,11 +134,11 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { path += '/'; AbstractFSNode *originalNode = g_system->getFilesystemFactory()->makeFileNodePath(path + filename); if (!HandlerUtils::permittedPath(originalNode->getPath())) { - setErrorMessageHandler(*client, _("Invalid path!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Invalid path!"))); return; } if (originalNode->exists()) { - setErrorMessageHandler(*client, _("There is a file with that name in the parent directory!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("There is a file with that name in the parent directory!"))); return; } @@ -152,7 +152,7 @@ void UploadFileClientHandler::handleBlockHeaders(Client *client) { Common::DumpFile *f = new Common::DumpFile(); if (!f->open(originalNode->getPath(), true)) { delete f; - setErrorMessageHandler(*client, _("Failed to upload the file!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("Failed to upload the file!"))); return; } @@ -181,7 +181,7 @@ void UploadFileClientHandler::handleBlockContent(Client *client) { if (client->noMoreContent()) { // if no file field was found - failure if (_uploadedFiles == 0) { - setErrorMessageHandler(*client, _("No file was passed!")); + setErrorMessageHandler(*client, HandlerUtils::toUtf8(_("No file was passed!"))); } else { setSuccessHandler(*client); } @@ -199,9 +199,9 @@ void UploadFileClientHandler::setSuccessHandler(Client &client) { client, Common::String::format( "%s<br/><a href=\"files?path=%s\">%s</a>", - _("Uploaded successfully!"), + HandlerUtils::toUtf8(_("Uploaded successfully!")).c_str(), client.queryParameter("path").c_str(), - _("Back to parent directory") + HandlerUtils::toUtf8(_("Back to parent directory")).c_str() ), (client.queryParameter("ajax") == "true" ? "/filesAJAX?path=" : "/files?path=") + LocalWebserver::urlEncodeQueryParameterValue(client.queryParameter("path")) |