boboson has asked for the wisdom of the Perl Monks concerning the following question:
Class::PhraseBook XML language file example<?xml version="1.0"?> <config> <language>SE</language> <login_successRM>start</login_successRM> <logoutRM>start</logoutRM> <reg_missing>åäötest</reg_missing> </config>
My problem comes with XML encoding. It encodes everything with utf-8. When I try to display my XML content from my config file and phrasebook file, the Swedish letters å, Å, ä, Ä and ö, Ö will not display correcty.<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE phrasebook [ <!ELEMENT phrasebook (dictionary)*> <!ELEMENT dictionary (phrase)*> <!ATTLIST dictionary name CDATA #REQUIRED> <!ELEMENT phrase (#PCDATA)> <!ATTLIST phrase name CDATA #REQUIRED> ]> <phrasebook> <dictionary name="SE"> <phrase name="1">startsida</phrase> <phrase name="2">live</phrase> <phrase name="3">musik</phrase> <phrase name="4">åäötest</phrase> </dictionary> <dictionary name="EN"> <phrase name="1">home</phrase> <phrase name="2">live</phrase> <phrase name="3">music</phrase> <phrase name="4">test</phrase> </dictionary> </phrasebook>
That did the trick for my XML output, but text from the HTML::Template files and Database does not output correctly anymore. I could use the following codes for the Swedish letters å, ä and ö$self->header_add( -type => 'text/html; charset=utf-8' );
but I can't rely that users of this webpage is going to use those codes for å, ä and ö everywhere.å ä ö
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML encoding problem
by mirod (Canon) on Mar 14, 2006 at 12:48 UTC | |
|
Re: XML encoding problem
by pajout (Curate) on Mar 14, 2006 at 12:42 UTC | |
|
Re: XML encoding problem
by izut (Chaplain) on Mar 14, 2006 at 12:48 UTC | |
|
Re: XML encoding problem
by wazoox (Prior) on Mar 14, 2006 at 17:40 UTC | |
by boboson (Monk) on Mar 15, 2006 at 09:34 UTC | |
by wazoox (Prior) on Mar 15, 2006 at 11:17 UTC | |
|
Re: XML encoding problem
by graff (Chancellor) on Mar 16, 2006 at 02:48 UTC |