Skip to content

Commit

Permalink
Android WebView Bugfix: loadUrl() ignores default encoding
Browse files Browse the repository at this point in the history
Closes facebook#17385

The loadUrl() method ignores the default encoding on Android KitKat.
  • Loading branch information
Adriano Melo committed Dec 30, 2017
1 parent a8391bd commit 54e1c4e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,11 @@ public void setSource(WebView view, @Nullable ReadableMap source) {
if (source != null) {
if (source.hasKey("html")) {
String html = source.getString("html");
String baseUrl = null;
if (source.hasKey("baseUrl")) {
view.loadDataWithBaseURL(
source.getString("baseUrl"), html, HTML_MIME_TYPE, HTML_ENCODING, null);
} else {
view.loadData(html, HTML_MIME_TYPE, HTML_ENCODING);
baseUrl = source.getString("baseUrl");
}
view.loadDataWithBaseURL(baseUrl, html, HTML_MIME_TYPE, HTML_ENCODING, null);
return;
}
if (source.hasKey("uri")) {
Expand Down

0 comments on commit 54e1c4e

Please sign in to comment.