Revision: 37518
Updated Code
at February 9, 2011 23:06 by adrianparr
Updated Code
import flash.text.TextField;
var myStr:String = "&%20<%20>%20"%20'%20£%20©%20%AE";
function htmlUnescape($str:String):String
{
var tf:TextField = new TextField();
tf.htmlText = unescape($str);
return tf.text;
}
trace(myStr);
trace(htmlUnescape(myStr));
// OUTPUT
// &%20<%20>%20"%20'%20£%20©%20%AE
// & < > " ' £ © ®
// This doesn't work for a lot of the other HTML Entity Names.
// For example, £ and © don't work.
// See here for a list of HTML Entity Names ...
// http://www.adrianparr.com/download/Special%20Characters%20Cheat%20Sheet.pdf
//
// For a full working class that supports ALL HTML Entity Names see here ...
// http://snipplr.com/view/46566/as3-encode-and-decode-html-entity-names-full-set/
Revision: 37517
Updated Code
at February 9, 2011 23:05 by adrianparr
Updated Code
import flash.text.TextField;
var myStr:String = "&%20<%20>%20"%20'%20£%20©%20%AE";
function htmlUnescape($str:String):String
{
var tf:TextField = new TextField();
tf.htmlText = unescape($str);
return tf.text;
}
trace(myStr);
trace(htmlUnescape(myStr));
// OUTPUT
// &%20<%20>%20"%20'%20£%20©%20%AE
// & < > " ' £ © ®
// This doesn't work for a lot of the other HTML Entity Names.
// For example, £ and © don't work.
// See here for a list of HTML Entity Names ...
// http://www.adrianparr.com/download/Special%20Characters%20Cheat%20Sheet.pdf
//
// For a full working class see here ...
// http://snipplr.com/view/46566/as3-encode-and-decode-html-entity-names-full-set/
Revision: 37516
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at December 11, 2010 06:20 by adrianparr
Initial Code
import flash.text.TextField;
var myStr:String = "&%20<%20>%20"%20'%20£%20©%20%AE";
function htmlUnescape($str:String):String
{
var tf:TextField = new TextField();
tf.htmlText = unescape($str);
return tf.text;
}
trace(myStr);
trace(htmlUnescape(myStr));
// OUTPUT
// &%20<%20>%20"%20'%20£%20©%20%AE
// & < > " ' £ © ®
// This doesn't work for a lot of the other HTML Entity Names.
// For example, £ and © don't work.
// See here for a list of HTML Entity Names ...
// http://www.adrianparr.com/download/Special%20Characters%20Cheat%20Sheet.pdf
Initial URL
Initial Description
Initial Title
AS3 Unescape HTML (inc. common Entity Names - But not all)
Initial Tags
html
Initial Language
ActionScript 3