修复GNUCash数据库中的乱码

GNUCash 是一款很好的记账软件,但在使用 MySQL 作为存储后端时,由于其对连接字符集的设置有漏洞,容易出现记账备注中的中文变乱码的情况。此时,可以在 MySQL 中执行如下 SQL 语句完成修复工作:

update splits set memo=convert(binary(convert(memo using latin1)) using utf8) where char_length(convert(binary(convert(memo using latin1)) using utf8))!=char_length(memo);
 

猜你喜欢

转载自chaoslawful.iteye.com/blog/1728620