Link | encode_decimalhtml |
Author | Jason Huck |
Category | Encoding |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 21 Jun 2006 |
Updated | 21 Jun 2006 |
More by this author... |
Internet Explorer doesn't support certain HTML equivalents used by the built-in [encode_html] (such as ™ for ™). This custom tag instead uses decimal equivalents for the encoding (so, ™ becomes ™), which seems to be more compatible. It also strips out the non-printing character codes 0-8 which will also render incorrectly in IE otherwise.
encode_decimalhtml($myText);
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'decimalhtml', -namespace='encode_', -required='in', -copy, -priority='replace', -description='HTML-encodes strings using decimal values for better IE compatibility.' ); local( 'in' = decode_html(#in), // avoid double-encoding 'out' = string, 'reserved' = array(34,38,60,62) ); iterate(#in, local('i')); if( #i->integer(1) > 127 || #reserved >> #i->integer(1) ); #out += '' + #i->integer(1) + ';'; else(#i->integer(1) > 8); #out += #i; /if; /iterate; return(@#out); /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft