如果通过以下方式连接到MySQL:
my $schema = MyDatabase::Main->connect("dbi:mysql:database=$database;host=$host",'root','', {mysql_enable_utf8 => 1});
连接强制为utf8;
连接到SQLite:
my $schema = MyDatabase::Main->connect('dbi:SQLite:data/sample.db', {sqlite_unicode => 1});
连接似乎不在 utf8 中;
目的是消除在获取数据时必须使用 decode() :来自:
Mojo::ByteStream->new($cycle->type)->decode('utf-8')
至:
$cycle->type
谢谢