WebView.loadData utf-8 encoding Android

Try this solution:

String DATA = "Html text....bla bla bla. Hellou world!  čšřžěéá";
String HEADERHTML = 
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" 
+"<html>  <head>  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">"  
+"</head>  <body>";
String FOOTERHTML = "</body></html>";
WebView mWebView.loadData(HEADERHTML+DATA+FOOTERHTML,"text/html; charset=UTF-8",null);
This entry was posted in Android Examples Code and tagged . Bookmark the permalink.


Comments are closed.



10,410 views