in reply to Confusing UTF-8 bug in CGI-script

use locale;

The ultimate secret to locales: "Avoid"

My guess is that your "web user" is not running under whatever "locale" you assume. I would specify the script encoding explicitly using encoding:

use encoding "greek"; # or whatever

Replies are listed 'Best First'.
Re^2: Confusing UTF-8 bug in CGI-script
by wanradt (Scribe) on Feb 01, 2011 at 15:50 UTC

    Thank, you! Locale is evil, once i wrote even node about it (any use of 'use locale'?), but i don't blame it here. At least commenting it out does have no effect.

    Nġnda, WK

      So, are you sure that your script is encoded as UTF-8? Because that's what you tell Perl:

      use utf8;

      If it is not encoded as that, that's likely what leads to these decoding errors and/or the crashes.

        Yes, i am. The hardcoded UTF-8 characters in script are showed properly. My full environment is UTF-8 and i work with them years. Still, here i am and could not find the bug.

        Nġnda, WK