问题
In web2py, how do I make sure that a column of type='string' uses the full 4-byte unicode format (utf8mb4) when creating tables in a mySQL database?
回答1:
From the web2py side, you can specify the encoding via the set_encoding
parameter in the connection string:
db = DAL('mysql://username:password@localhost/test?set_encoding=utf8mb4')
来源:https://stackoverflow.com/questions/39349972/how-do-i-specify-utf8mb4-for-a-mysql-column-in-web2py