ultranerds has asked for the wisdom of the Perl Monks concerning the following question:

I'm at a bit of a loss as to this one. I'm making use of the Net::eBay module, so that I can connect to my account + grab orders etc, ready to put into my DB. Now, this works just fine with normal characters - but with non-latin, it breaks. Here is the main code:

my $result = $ebay->submitRequest( "GetOrders",
                      {
                       DetailLevel => "ReturnAll",
                       ErrorLevel => "1",
                       SiteId => "1",
                       Verb => "GetOrders",
                       NumberOfDays  => 2,
                       OrderRole => "Seller",
                       OrderStatus => "Completed",
                       IncludeFinalValueFee => 1
                      });


If I use Devel::Peek to take a look at the var giving me the issue, with:

use Devel::Peek;
use Encode;
my $str = $add->{address};
Dump $str;


Which gives me in SSH:

SV = PV(0x28fa060) at 0x15df1f0
  REFCNT = 1
  FLAGS = (PADMY,POK,IsCOW,pPOK,UTF8)
  PV = 0x2d91730 ", Mario, Seestra\303\237e 12, Rodgau, 123456, Deutschland"\0 UTF8 ", Mario, Seestra\x{df}e 12, Rodgau, 123456, Deutschland"
  CUR = 57
  LEN = 72
  COW_REFCNT = 1
FOO: , Mario, Seestraße 12, Rodgau, 123456, Deutschland


...but in the DB, I get:

Mario, Seestraße 12, Rodgau, 123456, Deutschland


The mySQL table and columns are collation => "utf8_general_ci"

Anyone got any ideas? I've been battling this all morning, and still can't work out whats going on :/

TIA

Andy

Replies are listed 'Best First'.
Re: Encoding "fun" again
by choroba (Cardinal) on Aug 05, 2015 at 12:35 UTC
    How do you connect to the DB? Have you set the following attribute?
    mysql_enable_utf8 => 1
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ