Add <meta charset="UTF-8"> tag to websites. Fixed issue rendering emojis and other special characters.

This commit is contained in:
CalDescent 2022-02-21 22:28:59 +00:00
parent 8673c7ef6e
commit a2c462b3da

View File

@ -28,6 +28,11 @@ public class HTMLParser {
// Add base href tag
String baseElement = String.format("<base href=\"%s\">", baseUrl);
head.get(0).prepend(baseElement);
// Add meta charset tag
String metaCharsetElement = "<meta charset=\"UTF-8\">";
head.get(0).prepend(metaCharsetElement);
}
String html = document.html();
this.data = html.getBytes();