Flutterby™! : utf8 to HTML

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

utf8 to HTML

2014-03-08 00:14:32.99879+00 by Dan Lyke 0 comments

perl -Mutf8 -le 'while (<>) {utf8::decode(); s/([\x{ff}-\x{ffffffff}])/sprintf("&#%d;", ord($1))/eg; print ;}'

For those times when you need to get HTML entities for some gawdawful string.

[ related topics: Perl Open Source hubris ]

comments in ascending chronological order (reverse):