in reply to MacRoman Encoding Problem

Encode::Escape

The original encoding was Latin1, not MacRoman.

Replies are listed 'Best First'.
Re^2: MacRoman Encoding Problem
by Anonymous Monk on Aug 31, 2011 at 13:09 UTC
    Better supply a code sample:
    use Encode qw(); use Encode::Escape qw(); decode('Latin1', decode('unicode-escape', 'Walther-Straub-Institut + f\x{fc}r Pharmakologie und Toxikologie, Ludwig Maximillians-Universi +t\x{e4}t M\x{fc}nchen, Germany')) # returns a Perl string
Re^2: MacRoman Encoding Problem
by danj35 (Sexton) on Aug 31, 2011 at 13:15 UTC

    Thanks. Although perhaps I should have been more specific. I would like the string converted into this format:

    Walther-Straub-Institut für Pharmakologie und Toxikologie, Ludwig Maximillians-Universität München, Germany.

      #!/bin/env perl use strict; use warnings; binmode STDOUT, ':encoding(utf-8)'; print "Walther-Straub-Institut f\x{fc}r Pharmakologie und Toxikologie, + Ludwig Maximillians-Universit\x{e4}t M\x{fc}nchen, Germany\n";