in reply to Shooting at a Moving Target

I think it would be best to split the record on the escape character, convert each part to UTF8 separately and then merge the results back. Something like

my $record = "a" . $record; # prepend the ID of the default charset my @parts = split /\x1B/, $record; foreach my $part (@parts) { my $charset = substr( $part,0,1,''); $charset = $ESC{$charset}; # to get the name from the id $part = decode( $charset, $part); } $record = join '', @parts;

Replies are listed 'Best First'.
Re^2: Shooting at a Moving Target
by Anonymous Monk on Feb 09, 2007 at 22:11 UTC
    This is a very clear approach.
    I like the idea.
    I will have to look further into this line of thought.

    Thank you for your suggestion Jenda,

    /L