I did 4 tries

my $p_sAction = $oCGI->param( "action" ); $p_sAction = decode( 'UTF-8', $p_sAction ); if ( !defined( $p_sAction ) ){ print $oCGI->redirect( "access-denied.pl?reason=110" ); exit; } print "Content-type: text/html\n\n"; print "<html><head><meta charset=\"UTF-8\"></head>"; print "p_sAction: #" . $p_sAction . "#<br>"; print "1510 --- #$p_sAction# eq #$aText{'1510'}#<br><br>";

Output:
p_sAction: #Benutzer l&#65533;schen# 1510 --- #Benutzer l&#65533;schen# eq #Benutzer löschen#

my $p_sAction = $oCGI->param( "action" ); $p_sAction = decode( 'UTF-8', $p_sAction ); if ( !defined( $p_sAction ) ){ print $oCGI->redirect( "access-denied.pl?reason=110" ); exit; } print "Content-type: text/html\n\n"; print "<html><head><meta charset=\"UTF-8\"></head>"; print "p_sAction: #" . $p_sAction . "#<br>"; $aText{'1530'} = decode( 'UTF-8', $aText{'1510'} ); print "1510 --- #$p_sAction# eq #$aText{'1510'}#<br><br>";

Output:
p_sAction: #Benutzer l&#65533;schen# 1510 --- #Benutzer l&#65533;schen# eq #Benutzer löschen#

my $p_sAction = $oCGI->param( "action" ); $p_sAction = decode( 'UTF-8', $p_sAction ); if ( !defined( $p_sAction ) ){ print $oCGI->redirect( "access-denied.pl?reason=110" ); exit; } print "Content-type: text/html\n\n"; print "p_sAction: #" . $p_sAction . "#<br>"; print "1510 --- #$p_sAction# eq #$aText{'1510'}#<br><br>";

Output:
p_sAction: #Benutzer löschen# 1530 --- #Benutzer löschen# eq #Benutzer löschen#

my $p_sAction = $oCGI->param( "action" ); $p_sAction = decode( 'UTF-8', $p_sAction ); if ( !defined( $p_sAction ) ){ print $oCGI->redirect( "access-denied.pl?reason=110" ); exit; } print "Content-type: text/html\n\n"; print "p_sAction: #" . $p_sAction . "#<br>"; $aText{'1530'} = decode( 'UTF-8', $aText{'1510'} ); print "1510 --- #$p_sAction# eq #$aText{'1510'}#<br><br>";

Output:
p_sAction: #Benutzer löschen# 1530 --- #Benutzer löschen# eq #Benutzer löschen#


Still nothing matchs...
Update: If I add
if ( $p_sAction eq "Benutzer löschen" ){ print "HELLO WORLD 22222 - Benutzer löschen<br>"; }
it works ... so it has to be the encoding of $aText{'1510'} I'd say. Doesn't it?
I store the text in db like this: "Benutzer%20l%26ouml%3Bschen" (uriescaped_utf8), when I receive it, I uriunescape it and then I compare...

I read on stackoverflow (http://stackoverflow.com/questions/17599103/perl-comparing-2-accentuated-strings-with-different-encodingone-being-read-from) using Unicode::Normalize::NFD could help. For me it just makes it more worse.

In reply to Re^2: Decode umlauts on CGI-parameters by Yaerox
in thread Decode umlauts on CGI-parameters by Yaerox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.