advanced code snippet search
eszpee on 01/18/08
utf8 encode encoding i18n
01/18/08 11:38am
2 people have marked this snippet as a favorite
mellingmarkon89
use Encode; sub toutf8 {#takes: $from_encoding, $text#returns: $text in utf8 my $encoding = shift; my $text = shift; if ($encoding =~ /utf\-?8/i) { return $text; } else { return Encode::encode("utf8", Encode::decode($encoding, $text)); }}
Report this snippet Tweet
Comment:
You need to login to post a comment.