Hi,

First of all, I've read perlunitut, and also the page linked to from it (regarding UTF8). From my understanding, what I gotta do is:

use Encode; my $data = decode('UTF-8', $IN->param("data"));

...process it here

$data = decode('UTF-8', $data);

In my actual example script, I've used:

map { $cat_add->{$_} = encode("UTF-8",$cat_add->{$_} ); } keys %$cat_add;
(my script is creating a hash, which is getting passed into a DB module). The output of the script seems ok - but for some reason its broken in phpMyAdmin :/
Adding: Agricultura/Fumigación Aérea $VAR1 = { 'FatherID' => '75321', 'Full_Name_Flat' => 'agricultura/fumi +gacion aerea', 'Full_Name' => 'Agricultura/Fumigación Aérea', 'Name_E +nglish' => 'Aerial fumigation', 'Name' => 'Fumigación Aérea', 'CatDep +th' => '0' }; Done...
...and in phpmyadmin:
75321 Agricultura 0 0 0 Agricultura + 0 0 No No NULL 2012-09-04 03:11:10 + 0 Agriculture agricultura 75322 Fumigación Aérea 75321 75321 1 Agricultura +/Fumigación Aérea 0 0 No No + NULL 2012-09-04 03:11:10 0 Aerial fumigation + agricultura/fumigacion aerea

The annoying part is it works EVERYWHERE apart from phpmyadmin ... am I missing anything? I've been coding for a fair time now, and I've only just taken the time to really look into the best practices for utf8/unicode... makes a LOT more sense now - but for some reason this just doesn't seem to wanna play ball :/

TIA

Andy

In reply to UTF8 driving me up the wall again! by ultranerds

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.