From 501fd91ca3e9fa876ba8493b21ec9a2c08e1d893 Mon Sep 17 00:00:00 2001 From: Buuhuu Date: Thu, 9 Aug 2012 00:45:55 +0200 Subject: Used Android's Html class to convert HTML formated text to contentual string only. --- main/src/cgeo/geocaching/utils/TranslationUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main/src/cgeo') diff --git a/main/src/cgeo/geocaching/utils/TranslationUtils.java b/main/src/cgeo/geocaching/utils/TranslationUtils.java index e086ab6..5e5bb4b 100644 --- a/main/src/cgeo/geocaching/utils/TranslationUtils.java +++ b/main/src/cgeo/geocaching/utils/TranslationUtils.java @@ -4,6 +4,7 @@ import cgeo.geocaching.activity.AbstractActivity; import android.content.Intent; import android.net.Uri; +import android.text.Html; import java.net.URLEncoder; @@ -15,7 +16,7 @@ public final class TranslationUtils { private static final String translationWebsite = "http://translate.google.com/"; private static final String translationForceClassicMode = "?vi=c"; private static final String translationAutoSelect = "#auto"; - private static final String translationFieldSeparator = "|"; + private static final String translationFieldSeparator = "/"; public static final int translationTextLengthToWarn = 500; @@ -29,7 +30,7 @@ public final class TranslationUtils { * @return URI ready to be parsed */ public static String buildTranslationURI(final String toLang, final String text) { - return translationWebsite + translationForceClassicMode + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + URLEncoder.encode(text).replace("+", "%20"); + return translationWebsite + translationForceClassicMode + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + URLEncoder.encode(Html.fromHtml(text).toString()).replace("+", "%20"); } /** -- cgit v1.1