Search code examples
htmlactionscript-3flashspecial-characters

Including special chars in htmlText


How can I include special characters in htmlText? Specifically, I need to include this symbol: Ø. So far I tried ∅, \u2205 and \u2300, but the symbol is never shown. Copying the char itself only works with text property, so what is the appropriate way to include special chars?

This is my code:

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>"; 
}

Solution

  • try this,

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

    find all special characters here: http://dev.w3.org/html5/html-author/charref