loleaflet/src/core/Socket.js | 1 + loleaflet/src/layer/tile/TileLayer.js | 2 +- loolwsd/LOOLWSD.cpp | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit d18667d000e6a1374e035193a72a9a7933570c84 Author: Mihai Varga <[email protected]> Date: Tue Nov 17 20:06:59 2015 +0200 ccu#1273 support utf8 characters in the message passing server <-> client diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 02b0d72..d75a7cb 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -86,6 +86,7 @@ L.Socket = { // if it's not a tile, parse the whole message textMsg = String.fromCharCode.apply(null, imgBytes); } + textMsg = decodeURIComponent(window.escape(textMsg)); } else { var data = imgBytes.subarray(index + 1); diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 5b8a791..6232f52 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -904,7 +904,7 @@ L.TileLayer = L.GridLayer.extend({ } else { // Decode UTF-8. - e.clipboardData.setData('text/plain', decodeURIComponent(window.escape(this._selectionTextContent))); + e.clipboardData.setData('text/plain', this._selectionTextContent); } }, diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp index 3626953..31767a1 100644 --- a/loolwsd/LOOLWSD.cpp +++ b/loolwsd/LOOLWSD.cpp @@ -100,6 +100,7 @@ DEALINGS IN THE SOFTWARE. #include <Poco/FileStream.h> #include <Poco/TemporaryFile.h> #include <Poco/StreamCopier.h> +#include <Poco/URI.h> #include "LOOLProtocol.hpp" @@ -145,6 +146,7 @@ using Poco::Net::Socket; using Poco::ThreadLocal; using Poco::Random; using Poco::NamedMutex; +using Poco::URI; class QueueHandler: public Runnable { @@ -317,7 +319,9 @@ public: { // The user might request a file to download std::string dirPath = LOOLWSD::childRoot + "/" + tokens[1] + LOOLSession::jailDocumentURL + "/" + tokens[2]; - std::string filePath = dirPath + "/" + tokens[3]; + std::string fileName; + URI::decode(tokens[3], fileName); + std::string filePath = dirPath + "/" + fileName; std::cout << Util::logPrefix() << "HTTP request for: " << filePath << std::endl; File file(filePath); if (file.exists()) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
