I have a excel file with special characters like é, non-breaking spaces, and bullets(•).
How to handle these type of special characters while importing from excel to MySQL database using perl module Spreadsheet::ParseExcel?
Also i want to know default character set i have select for the creating the target table in the MySQL database.
Asked
Active
Viewed 581 times
0
-
1Some good background reading (aimed at PHP developers, but the principles are sound): [UTF-8 all the way through](http://stackoverflow.com/a/279279/623041). – eggyal Oct 06 '12 at 07:47
1 Answers
0
Not knowing what encoding the Excel file has but I'm assuming utf-8. If you're not manipulating the data etc.
For your problem I'd assume you're just pulling the data from the fields and putting them in mysql. Then you want to make sure the encoding in MySQL is utf-8 (either set it as default or set "CHARSET=utf8" on the tables). Then in perl do:
$dbh->do('SET NAMES utf8');
$dbh->{'mysql_enable_utf8'} = 1;
and you should be pretty safe.
There's tons to read about perl and utf-8, both here and around the internet.

Jon
- 188
- 1
- 8