Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

读取文件支持多种编码格式 #94

Closed
yanan-wu opened this issue Aug 1, 2018 · 1 comment
Closed

读取文件支持多种编码格式 #94

yanan-wu opened this issue Aug 1, 2018 · 1 comment
Milestone

Comments

@yanan-wu
Copy link

yanan-wu commented Aug 1, 2018

背景

agbot 读取数据文件和配置文件时,需求需要支持 gbk 和 utf-8 两种编码格式

实现

fishbase 中的 csv_file_to_list(csv_filename, deli=',', del_blank_row=True) 和 conf_as_dict(conf_filename) 方法增加默认参数 encoding=None,通过该参数指定读取的目标文件的编码。

@mindjun
Copy link
Contributor

mindjun commented Aug 2, 2018

在Python2中open操作不支持encodingPython2 open方法,故改操作在fishbase中Python3版本支持。

@itaa itaa closed this as completed Aug 6, 2018
@itaa itaa modified the milestones: v1.1.0, v1.0.16 Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants