in reply to Re^2: need help in printing German umlauts
in thread need help in printing German umlauts

Don't forget the trailing ?=:

#!/usr/bin/perl use feature qw/say/; use warnings; use strict; use Encode; my $str = "Wir freuen uns, dass Sie den 1&1 E-Mail-Service f=C3=BCr Ih +re=20"; say decode('MIME-Header', "=?iso-8859-1?Q?" . $str . "?=");

Output:

$ perl 1092761.pl Wir freuen uns, dass Sie den 1&1 E-Mail-Service für Ihre $

Replies are listed 'Best First'.
Re^4: need help in printing German umlauts
by opensourcer (Monk) on Jul 08, 2014 at 18:27 UTC
    Thanks a lot that resolved many issues, the encode doesn't work for Ü and ß
    instead prints as ~_ for ß and ~\ as for Ü
    Thanks again for the help

      Those work for me:

      #!/usr/bin/perl use feature qw/say/; use warnings; use strict; use Encode; my $str = "=C3=9C =C3=9F"; say decode('MIME-Header', "=?iso-8859-1?Q?" . $str . "?=");

      Output:

      $ perl 1092761.pl Ü ß $

      Are you sure your the encoded data's correct? The string should contain the UTF-8 encoding of the character, in essence (for instance, "ß" is C3 9F in UTF-8, so it's encoded as =C3=9F).