I ran some examples with Devel::Peek and this is my result:

I try to output: johan from the database with DBI

SV = PV(0x8e4fe98) at 0x8cdc584 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8f68b08 "Johan"\0 CUR = 5 LEN = 8

I try to output: Törjebjöåärne from the database with DBI
The UTF-8 flag is not set!

SV = PV(0x8e4fe98) at 0x8cdc584 REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK) PV = 0x8164d28 "T\303\266rjebj\303\266\303\245\303\244rne"\0 CUR = 17 LEN = 20

I try to output: testar from template

SV = PV(0x8e43e5c) at 0x8e46da4 REFCNT = 1 FLAGS = (TEMP,POK,pPOK) PV = 0x8ecbef0 "testar\n"\0 CUR = 7 LEN = 8

I try to output: testaråäöÅÄÖ from template
UTF-8 flag is set but I still get strange chars

SV = PV(0x8e43e5c) at 0x8e46da4 REFCNT = 1 FLAGS = (TEMP,POK,pPOK,UTF8) PV = 0x8eca838 "testar\357\277\275\357\277\275\357\277\275\357\277\2 +75\357\277\275\357\277\275\n"\0 [UTF8 "testar\x{fffd}\x{fffd}\x{fffd} +\x{fffd}\x{fffd}\x{fffd}\n"] CUR = 25 LEN = 28

In reply to Re^5: UTF-8 webpage output from MySQL by boboson
in thread UTF-8 webpage output from MySQL 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.