posted by Full-stack Developer 2011. 5. 16. 14:44
Webview content = new Webview(this);

String data="<html>"+
   "<head>"+ 
   "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"+
   "</head>"+
   "<body>"+
    "<div style=\"text-align:left\">"
    +"글로벌 금융위기 전후 4년간 한국인의20% 실질 재산이 6분의 1이나 감소한 것으 "   
+"</div>"+
   "</body>"+
   "</html>";



   content.loadData(data,"text/html;charset=UTF-8","UTF-8");

위와같이 할시 페이지를 찾을 수 없습니다가 나올 것이다...

이유는... %때문에..  이것을 html 특수문자표에서 해당 특수기호와 동일한 특수문자를 replace 시켜야한다.

String tuning = data;
   tuning = tuning.replaceAll("%", "&#37;");
   tuning = tuning.replaceAll("\n", "<br>");

위와같이 replaceAll을 이용해서 바꾸어주면 정상적으로 나올것이다...