如何在web2py中为mySQL列指定utf8mb4?

时间:2016-09-06 13:15:24

标签: mysql unicode web2py

在web2py中,如何确保type =' string'在mySQL数据库中创建表时使用完整的4字节unicode格式(utf8mb4)?

1 个答案:

答案 0 :(得分:1)

从web2py方面,您可以通过连接字符串中的set_encoding参数指定编码:

db = DAL('mysql://username:password@localhost/test?set_encoding=utf8mb4')