Closed sime-k closed 9 years ago
For some reason named connections don't get charset from settings. So an elegant workaround is to add charset: utf-8 to connection. In your case:
charset: "utf-8"
plugins:
Database:
driver: 'mysql'
database: 'data'
host: 'localhost'
username: 'user'
password: 'pass'
connections:
stats:
driver: 'mysql'
database: 'data'
host: 'localhost'
username: 'user'
password: 'pass'
charset: "utf-8"
Thanks! :+1:
Hmm - whilst you can, indeed, pass the charset parameter in each named connection, it doesn't seem reasonable behaviour for it to be automatically enabled for the "main" connection, but not for named connections - that's bound to surprise others - so I'm going to re-open this as still being a bug that ought to be fixed.
Indeed. I tested locally and I did not have any problem. So, I would really like to see this reproduced so we can fix the issue.
Oops: Ignore this, I did not set up the table properly.
As another interesting note: This is what I get from the mysql command-line client when I query a table with the example string.
Note: I inserted the string twice, once with the client set to UTF8 and once without.
mysql> insert into test (name) values ('ščćđ') mysql> select * from test; +-------+ | name | +-------+ | š??? | | š??? | +-------+
Just FYI. Submitted PR #59 which handles charset inheritance of named connections.
I think this is solved, so closing issue. Please let me know if not. Best,
Utf-8 works with default database but when i use additional one it returns.
Example: config.yml
data: {NAME=>ščćđ}
Dancer