Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24aecc3f authored by Victoria Lease's avatar Victoria Lease Committed by Android Git Automerger
Browse files

am 24a24b27: am ee4c8464: Merge "Handle surrogate pairs in Html.toHtml()" into klp-dev

* commit '24a24b27':
  Handle surrogate pairs in Html.toHtml()
parents d35e94a3 24a24b27
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -391,6 +391,15 @@ public class Html {
                out.append(">");
            } else if (c == '&') {
                out.append("&");
            } else if (c >= 0xD800 && c <= 0xDFFF) {
                if (c < 0xDC00 && i + 1 < end) {
                    char d = text.charAt(i + 1);
                    if (d >= 0xDC00 && d <= 0xDFFF) {
                        i++;
                        int codepoint = 0x010000 | (int) c - 0xD800 << 10 | (int) d - 0xDC00;
                        out.append("&#").append(codepoint).append(";");
                    }
                }
            } else if (c > 0x7E || c < ' ') {
                out.append("&#").append((int) c).append(";");
            } else if (c == ' ') {