文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Flex html-template(html wrapper) 乱码

Flex html-template(html wrapper) 乱码

时间:2010-05-06  来源:yzgname

    在html-template里输入中文后,Flex Builder显示正常,但是Build后中文乱码。应该是html wrapper的问题,根治的话可以用自己的Build脚本,但工作量很大。

    有一个Workarround,把中文转成HTML Unicode就行了。这个网站提供这样的工具。

http://ntu.csie.org/~piaip/unihtml/    

    也可以将以下的内容保存成html文件,用浏览器打开,进行转换。

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh-TW" xml:lang="zh-TW" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-9" />
<title>HTML unicode</title>
<script type="text/javascript">
    <!--
function convert()
{
  str = document.conv.str.value;
  result = "";

  for(i = 0 ; i < str.length ; i++) {
    c = str.charAt(i);
    if((' ' <= c && c <= '~') || (c == '\r') || (c == '\n')) {
      if(c == '&') {
        cstr = "&amp;";
      } else if(c == '<') {
        cstr = "&lt;";
      } else if(c == '>') {
        cstr = "&gt;";
      } else {
        cstr = c.toString();
      }
    } else {
      cstr = "&#" + c.charCodeAt().toString() + ";";
    }
      result = result + cstr;
  }

  document.conv.result.value = result;
  document.conv.result.focus();
  document.conv.result.select();

  return 0;
}
-->
</script>
</head>
<body>
<H1>HTML unicode</H1>
<form action="#" id="conv" name="conv">
    Original: <br/>
    <textarea id="str" cols="80" rows="10" onchange="convert();" onblur="convert();"></textarea><br/>
    <br/>Charcode: <br/>
    <textarea id="result" cols="80" rows="10" onfocus="convert();"></textarea><br/>
    <input type="button" value="Convert" onclick="convert();" onkeypress="convert" />
    &nbsp;&nbsp;<input type="reset" value="Clear"/><br/>
</form>
<hr />
</body>
</html>


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载