I am developing a webpage in 2 different languages. Swedish and English. I am using the CGI::Application framework with HTML::Template as a template system
I am using the Class::PhraseBook module to accomplish this.
Class::PhraseBook loads an XML file which holds my phrases in Swedish and English, it looks like this:
<?xml version="1.0"?> <!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">tävlingar</phrase> </dictionary> <dictionary name="EN"> <phrase name="1">comp</phrase> </dictiona +ry> </phrasebook>
I create the C::PhraseBook objekt in my CGI::App base class like this.
# get phrasebook $self->param('pb' => new Class::Phrasebook(undef, $self->param('phrase +_url')));
I load the correct language in my subroutines.
# phrasebook handle my $pb = $self->param('pb'); $pb->load("SE");
and substitute the variable in my HTML::Template file.
$tmpl->param(1 => $pb->get("1") );
I want it to print out the Swedish word "tävlingar" but I get the following word "tävlingar" I can't get the Swedish letters å,ä and ö to work with Class::PhraseBook. There is something with the encoding of the XML file that I am missing. I seems like Class::PhraseBook have already decided what encoding to use. Anybody have a solution?

In reply to can't get å,ä and ö to work with Class::PhraseBook by boboson

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.