Comments (9)
node-mysql 默认字符编码是utf-8的,把数据库和表的字符集都设置成 utf-8 的就行
from bearcat-dao.
DROP TABLE IF EXISTS IDGenerator;
create table IDGenerator(
name varchar(50) NOT NULL,
id bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
创建表的时候指定下字符集
from bearcat-dao.
mysql设置的是utf8,可是还是乱码,我用原生的node-mysql测了一下,将charset置成Latin1 是可以正常展示的,不懂为啥啊
from bearcat-dao.
你新插入数据看看?
from bearcat-dao.
我们这边的数据库的charset是Latin1
from bearcat-dao.
坑啊,别的服务要求latin1 把我给坑了,我在mysqlConnectManager.js这个文件中加了个charset字段。。。
MysqlConnectionManager.prototype.getConnectionOptions = function() {
var options = this.options || {};
options['host'] = this.host;
options['port'] = this.port;
options['user'] = this.user;
options['password'] = this.password;
options['database'] = this.database;
options['charset'] = this.charset; //新加的charset字段。。。
return options
}
···
from bearcat-dao.
然后在context.json里面配了个charset属性。。。
from bearcat-dao.
哈哈,欢迎pull request
from bearcat-dao.
已经加了哈
from bearcat-dao.
Related Issues (9)
- BeanBuilderUtil.buildObjecList问题 HOT 3
- domainDaoSupport.js的一些疑问 HOT 1
- this.domainDaoSupport.transaction(txStatus); 应该如何使用
- many transaction problem
- bearcat-dao context.json func路径问题 HOT 2
- 基于model的查询结果处理 HOT 1
- bearcat-dao 如何返回自增id?
- DomainDaoSupport.getList when use select* with where clause, always return empty array HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bearcat-dao.