#!/usr/bin/perl -w -CO use strict; use utf8; use CGI qw/:standard/; my $URLRAWDATA = ""; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $URLRAWDATA, $ENV{'CONTENT_LENGTH'}); } else { $URLRAWDATA = $ENV{'QUERY_STRING'}; } my %URLDATA; my @data = split (/&/, $URLRAWDATA); for (@data) { my ($key, $value) = split /=/; $value =~ s/%0D%0A/<\|br\|>/g; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $URLDATA{$key} = $value; } print "Content-type: text/html\n\n"; print "äöü "; # richtige Umlaute: äöü print $URLDATA{'name'}; # fehlerhafte Umlaute: äöü