Return to Snippet

Revision: 4735
at January 18, 2008 11:38 by eszpee


Initial Code
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));
    }
}

Initial URL

                                

Initial Description

                                

Initial Title
Convert a string to utf8

Initial Tags

                                

Initial Language
Perl