Recently in learning Squeryl, with the MySQL database, programmers are lazy, the program can do, resolute not manual to do. There is a method in scheme that creates a table, when inserting data through a program, it is not possible to insert Chinese, it is definitely a database encoding problem.
Then look at the next Mysqladapter and Databaseadapter, found that the table statement is implemented by the Writecreatetable method, you should be able to override the method to add the specified encoding.
The specific implementation of the code is
Import Org.squeryl. {Schema, Table}import org.squeryl.adapters.MySQLAdapterimport org.squeryl.internals.StatementWriterclass Mysqlutf8adapter extends Mysqladapter {override def Writecreatetable[t] (t:table[t], Sw:statementwriter, Schema:schema ) = {super.writecreatetable (t, SW, schema); Sw.write ("Engine=innodb DEFAULT Charset=utf8")}}
Extended squeryl support for MySQL encoding