• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

html nach xhtml konvertieren (tidy ?)

hi leute,

um html-text in xhtml umzuwandeln, verwende ich das kommandozeilen-tool tidy (w3c).

das problem ist, dass in den html-seiten zeichsätze wie:
'windows-1250' u.a. verwendet werden (es handelt sich z.B. um eine slovenische seite). dabei bekomme ich dann immer wieder 'wide character' - meldungen.


in tidy habe ich aber nur verhältnismässig wenige optionen für zeichsätze zur verfügung ...

Character encodings
-raw output values above 127 without conversion to entities
-ascii use ISO-8859-1 for input, US-ASCII for output
-latin0 use ISO-8859-15 for input, US-ASCII for output
-latin1 use ISO-8859-1 for both input and output
-iso2022 use ISO-2022 for both input and output
-utf8 use UTF-8 for both input and output
-mac use MacRoman for input, US-ASCII for output
-win1252 use Windows-1252 for input, US-ASCII for output
-ibm858 use IBM-858 (CP850+Euro) for input, US-ASCII for output
-utf16le use UTF-16LE for both input and output
-utf16be use UTF-16BE for both input and output
-utf16 use UTF-16 for both input and output
-big5 use Big5 for both input and output
-shiftjis use Shift_JIS for both input and output
-language <lang> set the two-letter language code <lang> (for future use)

... gibt es da noch weitere optionen ?


oder vielleicht gibt es da überhaupt noch eine bessere idee wie man sowas machen kann.
soll aber irgendwie aus einem script (oder kommando-zeile) herraus ausgeführt werden.
am liebsten wäre mir eine perl oder php lösung.

danke im vorraus

mfg abe
 
danke erstmal für deine antwort,


da kommt dann folgende meldung

not well-formed (invalid token) at line 22, column 46, byte 732 at /usr/lib/perl5/vendor_perl/5.8.7/i586-linux-thread-multi/XML/Parser.pm line 187

... also ist es nicht wohlgeformt


ich habe auch schon alle anderen varianten versucht...

es kommt immer sowas wie 'not wellformed', 'undefined entity at ...' oder 'wide character'

habe echt keinen plan wie ich das wegkriege...
 
dann lösche mal Zeilen aus Deinem HTML und mach ein Minimalbeispiel, dann sieht man an welchem zeichen es hängt... so können wir alle nur Raten.
 
Konvertiere die Dateien (mit iconv oder recode) nach UTF-8
Dann tidy im UTF-8 Modus
Danach entweder den Charset auf UTF-8 umstellen oder mit iconv wieder alles nach windows-1234 wandeln.
 
Oben