in reply to Re: Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel
in thread Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel

Ah, sorry, I wasn't clear.

The issue isn't at the database. When I edit the .SQL file my Perl script produces, I see the mangled data there.

I didn't even get to the point of running the SQL script to load the data, after seeing the Unicode characters not making it into the .SQL file properly.

  • Comment on Re^2: Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel

Replies are listed 'Best First'.
Re^3: Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel
by Corion (Patriarch) on Apr 09, 2010 at 07:25 UTC

    Then, are you sure that your .SQL file is UTF-8, and that the text editor you're using to view it understands UTF-8? Most likely you'll want to tell Perl to encode output to UTF-8:

    open my $sql_file, '>:encoding(UTF-8)', $sql_name or die "Couldn't create '$sql_name': $!";

      Thanks for your response! Yes to both Qs. The script prints the SQL to STDOUT and I redirect output to a file. The script sets the output encoding to UTF-8 with

      binmode STDOUT, ':utf8';