I think the perl script has the character as a utf8 byte sequence, and that is what is going into the database. No problem with that.

When you say "it comes out in mysql as ...", I expect you mean something like "when I use an xterm or an MS-DOS prompt window or some other thing where I can run mysql and issue queries interactively, the display I get is ...".

This would be expected assuming that your xterm or MS-DOS prompt window or whatever is displaying the data as if it were ISO-8859-1 or CP-1251 or some similar single-byte legacy character set. If you had a utf8-capable display window where you could see the output from mysql (e.g. a browser), it would show the utf8-encoded character correctly.

(update: just to be clear -- it's a display issue, not a data or perl issue per se)

(another update -- sorry I didn't happen to notice this sooner: if you set your browser to UTF8 and look at your own post, you'll see the single-character currency mark that I presume you intended to have in the database.)


In reply to Re: Perl mySQL and £ signs by graff
in thread Perl mySQL and £ signs by davepreece

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.