在htmlText中包含特殊字符

时间:2014-08-22 08:59:43

标签: html actionscript-3 flash special-characters

如何在htmlText中添加特殊字符?具体来说,我需要包含这个符号:Ø。到目前为止,我尝试了∅\u2205\u2300,但该符号从未显示过。复制char本身只适用于text属性,那么包含特殊字符的适当方法是什么?

这是我的代码:

this.text1.htmlText = toHtmlText(s); 

function toHtmlText(s:String):String{
   return "<font size=\"32\">" + 
          "\u2205" + // also tried '&empty;' and '\u2300'
          " </font><font size=\"64\">" + 
          s +
          "</font>"; 
}

2 个答案:

答案 0 :(得分:0)

使用以下HTML实体:

&Oslash;

您也可以浏览此链接http://www.utexas.edu/learn/html/spchar.html

答案 1 :(得分:0)

试试这个,

this.text1.htmlText = toHtmlText(s); 

function toHtmlText(s:String):String{
   return "<font size=\"32\">" + 
          "\&#216;" +
          " </font><font size=\"64\">" + 
          s +
          "</font>"; 
}

在此处找到所有特殊字符:http://dev.w3.org/html5/html-author/charref

相关问题