lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 768da8bf8fa20848d5da9dfc56b1b8ce42b1404f Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Mon Oct 16 12:26:10 2023 +0300 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Oct 22 21:50:28 2023 +0200 Don't encode the text when sending it to Duden corrector. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: I9e1a2adede04858e5c43b878786bbcc28922aa5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158023 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 8989cba47fce3763229005b1ed2fec74da7cfb72) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158333 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index d1c87af5fa0a..79d061e42c85 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -427,14 +427,14 @@ ProofreadingResult SAL_CALL LanguageToolGrammarChecker::doProofreading( = std::min(xRes.nStartOfNextSentencePosition, aText.getLength()); OString langTag(LanguageTag::convertToBcp47(aLocale, false).toUtf8()); - OString postData = encodeTextForLanguageTool(aText); + OString postData; const bool bDudenProtocol = LanguageToolCfg::RestProtocol::get().value_or("") == "duden"; if (bDudenProtocol) { std::stringstream aStream; boost::property_tree::ptree aTree; aTree.put("text-language", langTag.getStr()); - aTree.put("text", postData.getStr()); + aTree.put("text", aText.toUtf8()); // We don't encode the text in Duden Corrector tool case. aTree.put("hyphenation", false); aTree.put("spellchecking-level", 3); aTree.put("correction-proposals", true); @@ -443,7 +443,7 @@ ProofreadingResult SAL_CALL LanguageToolGrammarChecker::doProofreading( } else { - postData = "text=" + postData + "&language=" + langTag; + postData = "text=" + encodeTextForLanguageTool(aText) + "&language=" + langTag; } if (auto cachedResult = mCachedResults.find(postData); cachedResult != mCachedResults.end())