Skip to content
Snippets Groups Projects
Commit 3bde1ae5 authored by Thomas's avatar Thomas
Browse files

Fix a potential crash when translating with MinT

parent 78fccc95
Branches
Tags
No related merge requests found
......@@ -373,8 +373,11 @@ public class Translate {
//Retrieves the translated content
String content;
try {
content = URLDecoder.decode(translationJson.getString("translation"), "utf-8");
} catch (UnsupportedEncodingException e) {
String data = translationJson.getString("translation");
data = data.replaceAll("%(?![0-9a-fA-F]{2})", "%25");
data = data.replaceAll("\\+", "%2B");
content = URLDecoder.decode(data, "utf-8");
} catch (Exception e) {
content = translationJson.getString("translation");
}
translate.setTranslatedContent(content);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment