react native 0.50.3 android webkit html Chinese garbled
See original GitHub issueIs this a bug report?
YES
Have you read the Contributing Guidelines?
YES
Environment
Steps to Reproduce
(Write your steps here:) After I upgraded to version 0.50.3, there was no code for the webkit HTML in android, and none of the 0.49 version had this problem
<WebView
source={{html: `<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="chrome=1"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;" name="viewport"><style>img {max-width: 100%}</style></head><body><p>这里是测试中文</p><script>var count = 0;function updateHeight(){window.location.hash = count++;document.title = document.body.clientHeight;};window.onload=window.onresize=function(){updateHeight();setTimeout(updateHeight, 1000);}</script></body></html>`}}
style={{flex:1, height: this.state.height, minHeight: 500}}
bounces={false}
scrollEnabled={false}
scalesPageToFit={true}
automaticallyAdjustContentInsets={true}
onNavigationStateChange={this.onNavigationStateChange}
>
</WebView>
Expected Behavior
Normal display Chinese
Actual Behavior
Chinese scrambled
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
WebView - React Native
Loads static HTML or a URI (with optional headers) in the WebView. ... On Android, the only supported methods are GET and POST....
Read more >react native - Expo-Vector-Icons show up on my Snack but are ...
Expo-Vector-Icons show up on my Snack but are showing as question mark or Chinese character in the Android built app · android ·...
Read more >[fedora-arm] arm rawhide report: 20140712 changes
New package: gcin-2.8.2-2.fc21 An input method focused on Chinese users New package: gcolor2-0.4-8.fc21 A simple color selector for GTK+2 ...
Read more >raspbian.grn.cat/raspbian/dists/stretch-staging/ma...
This package includes the html documentation for 389-ds-console. ... Description: Android Asset Packaging Tool The Android Asset Packaging Tool (aapt) takes ...
Read more ></s> 56499297 the 69513454 , 55850777 . 51967804
8483 corrupt 8482 greenwich 8482 simplified 8481 defendant 8480 ... delicate 5273 provoked 5271 boyle 5271 commodity 5271 react 5270 emigration 5270 suppose ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
well, I found a solution for this problem. it seems to be an android bug of
WebView.loadData
method, addingbaseUrl: ''
to source props forces native side to useWebView.loadDataWithBaseUrl
instead, which works well with other languages. maybe you guys can have a try @fuxianwei @efkan@Tennen Save me hours 👍