-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql_enable_utf8 => 1 does not encode to utf8 when using some special characters like 'á' or 'ú' #409
Comments
Ever tried doing
at the beginning of your session? |
YES.
or
I must repeat, that it should work for ALL characters or NONE. Its working for SOME. |
Is it, by chance, working with characters that are historically in latin-1 but not in whatever 8-bit codepage used to serve your language (looks like Slovak or Czech, so iso8859-2 or cp1252)? Or vice versa? The thing is that your code should be UTF8 across the board, and if the unicode is in your perl source, you need to |
Everything is in UTF-8 on input or output. I am using:
in every file. I am using i am using Also everything is woking fine with DBD::MariaDB. I am mostly using this source: And thank You for Your help Yaroslav. |
It's interesting because I haven't run into this and I'm using Unicode a lot. Granted, I'm still using DBD::mysql 4.050, so there might have been a regression or other, because I can see that barring some system setting on the way, you haven't left a stone unturned here (system locale in both client and server? The character set declared on the table columns themselves maybe?). Sorry that I had to ask all of this stuff, but since I've had my own problems with Unicode, I just know how hard it can be to make sure all ducks are really in a row and how one stupid setting can ruin a week. |
This is likely an instance of the Unicode bug present in this distribution and why you should use DBD::MariaDB, see https://github.com/perl5-dbi/DBD-mysql/issues?q=is%3Aissue+is%3Aopen+label%3Autf8 and https://blogs.perl.org/users/grinnz/2023/12/migrating-from-dbdmysql-to-dbdmariadb.html. The workaround if so would be to call utf8::upgrade on any unicode strings immediately before passing them as parameters (it operates on the string in-place, and leaves the string unchanged to Perl but different to broken interpretations like DBD::mysql). |
DBD::mysql version
5.1.0
MySQL client version
8.0.32
Server version
8.0.34
Operating system version
Linux Gentoo (kernel 6.6.8)
What happened?
DBD should encode texts into UTF-8 with mysql_enable_utf8 => 1 flag.
It works only:
It is not working:
Other information
No response
The text was updated successfully, but these errors were encountered: