Perl DBI/Mysql Unicode Bug -
I'm not sure whether this is a bug or I'm doing something wrong:
I've read the data Copy
open my $ FH, "& lt ;: encoding (ISO-Latin1)", $ file or dead "$ file failed to open: $!";
The $ file is definitely in the ISO latin1.
So I check the mysql table
engine = InnoDB AUTO_INCREMENT is = 53072 default charset = latin1
I connection settings :
$ dbh- & gt; ("Show variables");
What does
character_set_client, latin1 character_set_connection, latin1 character_set_database, latin1 character_set_filesystem, binary character_set_results, latin1 character_set_server, latin1 character_set_system, UTF8
< /The data iso-latin 1 (now the pearl must be internal letter format) / li> Connection information is correct settings STDOUT (output terminal Iso- is Latinl) straight but the data in the table is plain UTF8 (possibly internal format in the case of Pearl).
Do I miss something this is probably a bug in DBI / DBD :: MySQL?
My guess would be that you are right and this data is in the internal character of Pearl. The sequence goes like this.
- The data stored in the input file as Latin-1 bytes
- The encoding options input file and automatically convert Pearl characters your
open
statement - the data referred to as the Pearl characters to MySQL
- MySQL getting a bit rather than UTF8 confused with Latin-1, but also the best way it Store it
Before sending your unavailable stage to the database, you need to type the Pearl characters. It's encoding back into the Latin 1. Be clear solution in the encode ( "ISO -885 901, is $ string)
on every value to call it would be nice if someone types into the self-encode options. But I can not find anyone.
Of course, if your data is going to be Latin-1, then you can only consider ignoring any decoding / encoding problems. All this should work without that complexity.
Comments
Post a Comment