Since nobody has answered you so far, I'll try to give it a shot.

When you write use encoding 'cp1250'; it doesn't magically mean that everything you do is magically in the cp1250 encoding; it really means that you declare your source code to be in that encoding, and that operations on STDIN and STDOUT work in that encoding, too.

At the same time you lose thread safety, and introduce bugs with AUTOLOAD methods.

Instead you should try to understand the string model in Perl. For that I recommend reading this article and/or the wikibook.

Then you have to get proper Perl strings out of your database; typically that works by upgrading your perl database driver (some DBD:: modules) to a rather new version, and pass some encoding related options to the DBI->connect call. More information can be found in the documentation of the appropriate DBD:: module.

Then you have to take care that data from other sources is also decoded from their current character encoding into perls internal string format, and are encoded on output again.

I recommend writing the script in UTF-8 and use the utf8 pragma (which is much less bug ridden than the encoding pragma), and either set up the IO layers manually, or use the open pragma to do that for you.

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

In reply to Re: illegal mix of collations by moritz
in thread illegal mix of collations by demo055

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.