Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

导出csv时,中文显示乱码 #540

Closed
xiaomingdaily opened this issue Sep 14, 2016 · 7 comments
Closed

导出csv时,中文显示乱码 #540

xiaomingdaily opened this issue Sep 14, 2016 · 7 comments

Comments

@xiaomingdaily
Copy link

xiaomingdaily commented Sep 14, 2016

这块主要是utf8的原因。excel打开utf8格式的文件时,中文会显示乱码。
网上搜索解决方案为:人肉地先使用notepad++把格式转化为ascii,然后再用excel打开。

需求:
是否可以修复此处bug,使后续导出csv时中文默认显示正常?

@beader
Copy link
Contributor

beader commented Sep 14, 2016

This is not a bug of pyspider. It is a "bug" of Excel.
What operating system are you using. Mac OS, Windows, Linux?
What version of Excel are you using?

@binux
Copy link
Owner

binux commented Sep 14, 2016

  1. You can "Import the data using Data-->Import External Data --> Import Data" instead of directly open it.
  2. Can you test is "adding UTF-8 BOM" (use notepad++ save as UTF-8 DOM format) working for you. If so, we could add UTF-8 BOM to csv depends on user's UA.

@beader
Copy link
Contributor

beader commented Sep 15, 2016

@binux After doing some experiments on my mac's Excel, it seems like Excel can only open csv files of "UTF-16 LE with BOM".

@xiaomingdaily
Copy link
Author

我使用的是windows,主要是中文,英文无影响。

@binux
Copy link
Owner

binux commented Sep 18, 2016

@xiaomingdaily

  1. 你可以使用「导入数据」功能打开 csv,而不是双击。导入时可以指定编码为 UTF8
  2. 你可以试试 UTF-8 with BOM 格式的文件在你的系统上是否可用(用 notepad++ 另存为 UTF-8 with BOM 格式)。

@stirb520
Copy link

我的系统win10,execl2010,按照binux的方法,先用notepad++另存为utf-8 with bom格式后,用excel正常打开没有乱码,感谢。

@binux
Copy link
Owner

binux commented Dec 29, 2016

As @xiaomingdaily didn't respond, I will close this issue for now.

@binux binux closed this as completed Dec 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants