(und PERL) unerwartete Validator-Meldung
Christoph Schnauß
- html
guten Abend ;-)
Bei einer (lokalen) Seite, die ich durch den Validator gejagt habe, bekomme ich plötzlich die mir bisher unbekannte Mitteilung:
"Sorry, I am unable to validate this document because on lines 22, 25, 28 it contained one or more bytes that I cannot interpret as us-ascii (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication."
Diese "angemeckerten" Zeilen enthalten deutsche Umlaute - ä und ü.
Das Problem ist, daß es sich um ein "generiertes Dokument" handelt (siehe mein Thread [pref:t=49615&m=271203]. Ich bin eigentlich froh, daß ich mein PERL-Script dazu bringen konnte, überhaupt die Umlaute zu schreiben. Für die Darstellung der Umlaute gibt es diese RegExpressions:
$text =~ s/ä/ä/g;
$text =~ s/ö/ö/g;
$text =~ s/ü/ü/g;
$text =~ s/ß/ß/g;
Muß ich jetzt anstelle von "ß" für "ß" die Schreibweise ß noch einbauen?
Grüße aus Berlin
Christoph S.
Hallo Christoph,
Warum verwendest du eigentlich nicht HTML::Entities? Es würde auch dein Problem lösen.
use HTML::Entities;
encode_entities($text);
$xNeTworKx.
rehi,
Warum verwendest du eigentlich nicht HTML::Entities?
Weil ich auf _diese_ Idee noch nicht gekommen bin ;-)
Dankesehr, ich probiere mal.
Grüße aus Berlin
Christoph S.
Hi,
Bei einer (lokalen) Seite, die ich durch den Validator gejagt habe, bekomme ich plötzlich die mir bisher unbekannte Mitteilung:
"Sorry, I am unable to validate this document because on lines 22, 25, 28 it contained one or more bytes that I cannot interpret as us-ascii (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication."
Hast Du den CSS- oder den HTML-Validator benutzt?
Beim CSS-Validator gibt es einen Bug, daß der (mindestens) bei XML-Dokumenten Umlaute nicht verträgt...
Da hilft afaik nur, das CSS-File direkt zu validieren.
Falls doch HTML - laß mal die ersten 22 Zeilen sehen...
cu,
Andreas