<NME> HtmlUtils.java
<BEF> package cgeo.geocaching.utils;

import android.text.Spanned;
import android.text.style.ImageSpan;

import androidx.annotation.NonNull;
import androidx.core.text.HtmlCompat;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;

public final class HtmlUtils {

    private HtmlUtils() {
        // utility class
    }

    /**
     * Extract the text from a HTML based string. This is similar to what HTML.fromHtml(...) does, but this method also
     * removes the embedded images instead of replacing them by a small rectangular representation character.
     */
    @NonNull
    public static String extractText(final CharSequence html) {
        if (StringUtils.isBlank(html)) {
            return StringUtils.EMPTY;
        }
        String result = html.toString();

        // recognize images in textview HTML contents
        if (html instanceof Spanned) {
            final Spanned text = (Spanned) html;
            final Object[] styles = text.getSpans(0, text.length(), Object.class);
            final List<Pair<Integer, Integer>> removals = new ArrayList<>();
            for (final Object style : styles) {
                if (style instanceof ImageSpan) {
                    final int start = text.getSpanStart(style);
                    final int end = text.getSpanEnd(style);
                    removals.add(Pair.of(start, end));
                }
            }

            // sort reversed and delete image spans
            Collections.sort(removals, (lhs, rhs) -> rhs.getRight().compareTo(lhs.getRight()));
            result = text.toString();
            for (final Pair<Integer, Integer> removal : removals) {
                result = result.substring(0, removal.getLeft()) + result.substring(removal.getRight());
            }
        }
        return StringUtils.replace(result, "<br />", "\n").trim();
    }

}

<MSG> Merge remote-tracking branch 'campbeb/fix6a' into 6b

Conflicts:
	main/src/cgeo/geocaching/connector/gc/GCParser.java

<DFF> @@ -53,4 +53,29 @@ public class HtmlUtils {
         return StringUtils.replace(result, "<br />", "\n").trim();
     }
 
+    /**
+     * Convert any non-Latin characters into their HTML escaped equivalents
+     * 
+     * @param input
+     *            String
+     * @return output String
+     */
+    public static String convertNonLatinCharactersToHTML(final String input) {
+        final int inputLen = input.length();
+        final StringBuilder output = new StringBuilder();
+
+        for (int i = 0; i < inputLen; i++) {
+            char c = input.charAt(i);
+
+            if (c > 300) {
+                output.append("&#");
+                output.append(Integer.toString(c));
+                output.append(';');
+            } else {
+                output.append(c);
+            }
+        }
+
+        return output.toString();
+    }
 }

Merge remote-tracking branch 'campbeb/fix6a' into 6b