sequel never returns utf-8, just ascii-8bit

前端 未结 2 1942
梦如初夏
梦如初夏 2020-12-31 09:11

There is this mysql database I\'m trying to connect to. DataMapper fetches everything nicely in UTF-8 but Sequel always returns strings in ASCII-8bit which produces errors w

相关标签:
2条回答
  • 2020-12-31 09:45

    Encoding can be passed as do :

    Sequel.connect("mysql2://user:pass@localhost/the_database?encoding=utf8")
    
    0 讨论(0)
  • 2020-12-31 09:59

    Try Sequel.mysql2 instead of Sequel.mysql. Sequel.mysql uses the old mysql driver instead of the new mysql2 driver, and I don't believe the mysql driver supports encodings.

    0 讨论(0)
提交回复
热议问题