From: Reimar Döffinger Date: Wed, 9 Dec 2015 17:20:49 +0000 (+0100) Subject: Encode URLs as ASCII, avoid UTF-8. X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=commitdiff_plain;h=67991ce724e193b193f1c1d35e013b1c817f0aab Encode URLs as ASCII, avoid UTF-8. This is necessary for links to work on Android 2.x. --- diff --git a/src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java b/src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java index e8a7e9b..502e92a 100644 --- a/src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java +++ b/src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java @@ -318,7 +318,7 @@ public class WholeSectionToHtmlParser extends AbstractWiktionaryParser { final String webUrl = String.format(webUrlTemplate, title); // URI.create can raise an exception e.g. if webUrl contains %, just ignore those cases. try { - callback.builder.append(String.format("

%s", URI.create(webUrl).toString(), escapeHtmlLiteral(webUrl))); + callback.builder.append(String.format("

%s", URI.create(webUrl).toASCIIString(), escapeHtmlLiteral(webUrl))); } catch (Exception e) {} }