Javascript UTF8字符串在HTML iOS中未正确呈现?
在我的项目中,我将区域语言(malayalam)文本(长度:1900)从xcode WebViewDidFinishLoad传递到用html页面编写的javascript函数Javascript UTF8字符串在HTML iOS中未正确呈现?,javascript,html,ios,uiwebview,Javascript,Html,Ios,Uiwebview,在我的项目中,我将区域语言(malayalam)文本(长度:1900)从xcode WebViewDidFinishLoad传递到用html页面编写的javascript函数 function loadArticle(heading, img, desc, date){ document.body.scrollTop = 0; if(img == null || img == "null"){ document
function loadArticle(heading, img, desc, date){
document.body.scrollTop = 0;
if(img == null || img == "null"){
document.getElementById("image").style.display = "none";
}else{
addImg(img);
document.getElementById("image").style.display = "block";
}
addHeading(heading);
addDesc(desc);
addDate(date);
}
function addDesc(desc){
alert(desc); //is working fine . i can see my big text here
document.getElementById('description').innerHTML = desc;
return desc;
}
我也在使用这些元标记
<meta charset="UTF-8">
<script type="text/javascript" charset="UTF-8">
在我的html部分
<body>
<div id="heading" style="font-size:26px;"></div>
<h6 id="date"></h6>
<p>
<img id="image" src="" width="auto" width="auto" style="margin-right:10px;margin-bottom:0px;"/>
<span id="description" width="320" style="font-size:18px;"> </span>
</p>
</body>
当我在xcode中硬编码并传递大文本时,它工作正常(任何语言),但当我从xml解析并将值从xcode传递到html时,它不会显示(javascript警报显示正确的值)
请帮忙
<body>
<div id="heading" style="font-size:26px;"></div>
<h6 id="date"></h6>
<p>
<img id="image" src="" width="auto" width="auto" style="margin-right:10px;margin-bottom:0px;"/>
<span id="description" width="320" style="font-size:18px;"> </span>
</p>
</body>