- // No way to get pure UTF-8 data into WebView
- html = Base64.encodeToString(html.getBytes(StandardCharsets.UTF_8), Base64.DEFAULT);
+ try {
+ // No way to get pure UTF-8 data into WebView
+ // Cannot use StandardCharsets due to older Android.
+ html = Base64.encodeToString(html.getBytes("UTF-8"), Base64.DEFAULT);
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException("Missing UTF-8 support?!", e);
+ }