Thread CGI - Response und Umlaute (7 answers)
Opened by webwude at 2013-04-06 18:00

pq
 2013-04-07 18:35
#166936 #166936
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
dann lass doch mal sehen.
wie gesagt, benutze Devel::Peek.

hier ein beispiel:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ perl -wE'
use HTML::Entities;
use Devel::Peek;
use Encode;
my $string = "häufig Datenschutzerklärung";
$decoded = decode_entities($string);
Dump $decoded;
say encode_utf8 decode("latin1", ($decoded));
'
SV = PV(0x17f0b58) at 0x180fc58
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x1819990 "h\344ufig Datenschutzerkl\344rung"\0
CUR = 27
LEN = 40
häufig Datenschutzerklärung

das ist ein ä in latin1.
wenn du eine utf-8-ausgabe willst, musst du es dann mit Encode::decode("latin1", $string) umwandeln.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread CGI - Response und Umlaute