Wolfgang has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm using Catalyst::View::Template on different servers. Unfortunately the output of the same templates differs, depending on the server used.

The original template is utf-8 coded. The output is supposed to be utf-8 coded as well. This works fine on server 1, the utf-character 'C3 BC' (german Umlaut 'ü') is shown correctly by 'cat' and after processing by the browser.

On server 2 the file is identical, the umlaut is shown correctly by 'cat' but the browser receives a 'C3 83 C2 BC' which does not look nice :-(

I assume that Template::Provider does the translation, but why?

On server 1 there exists a locale utf-8, on server 2 it does not. May that be the problem?

Wolfgang
  • Comment on Encoding of web page differs on different servers

Replies are listed 'Best First'.
Re: Encoding of web page differs on different servers
by moritz (Cardinal) on Nov 20, 2009 at 11:22 UTC
    If cat shows the correctly while the browser does not, the difference is mostly like a wrong header on one of the servers.

    Try

    wget -S $url

    For both servers and compare the Content-Type headers.

    I'd also recommend installing an UTF-8 locale, because perl sometimes does funny things without it. (I never found out what exactly went wrong, but with a working locale I had much less headache).

    Perl 6 - links to (nearly) everything that is Perl 6.
      Hi Moritz.

      declared encoding is the same in both cases.

      you wrote I'd also recommend installing an UTF-8 locale, because perl sometimes does funny things without it. (I never found out what exactly went wrong, but with a working locale I had much less headache).

      Exactly that is my feeling, too

      Wolfgang