Browse Source

Fix Android WebView with garbled UTF-8 characters

taken from the last line of https://stackoverflow.com/a/10831462/728287
Gianfrancø Palumbo 6 years ago
parent
commit
513886775c
No account linked to committer's email address

+ 1
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

@@ -506,7 +506,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
506 506
           view.loadDataWithBaseURL(
507 507
               source.getString("baseUrl"), html, HTML_MIME_TYPE, HTML_ENCODING, null);
508 508
         } else {
509
-          view.loadData(html, HTML_MIME_TYPE, HTML_ENCODING);
509
+          view.loadData(html, HTML_MIME_TYPE + "; charset=" + HTML_ENCODING, null);
510 510
         }
511 511
         return;
512 512
       }