首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >odoo 8中的excel导出数据出错

odoo 8中的excel导出数据出错
EN

Stack Overflow用户
提问于 2016-12-19 19:07:32
回答 1查看 296关注 0票数 0

当我想要导出我的数据时,我得到这个错误

我在Windows7上工作,我检查了我的文件"site.py“

代码语言:javascript
复制
def setencoding():
"""Set the string encoding used by the Unicode implementation.  The
default is 'ascii', but if you're willing to experiment, you can
change this."""
encoding = "ascii" # Default value set by _PyUnicode_Init()
if 0:
    # Enable to support locale aware default string encodings.
    import locale
    loc = locale.getdefaultlocale()
    if loc[1]:
        encoding = loc[1]
if 0:
    # Enable to switch off string to Unicode coercion and implicit
    # Unicode to string conversion.
    encoding = "undefined"
if encoding != "ascii":
    # On Non-Unicode builds this will raise an AttributeError...
    sys.setdefaultencoding(encoding) # Needs Python Unicode build !
EN

回答 1

Stack Overflow用户

发布于 2016-12-19 21:15:59

您必须在site.py中设置另一种编码才能使用,例如utf-8。该文件如下所述:

,但如果你愿意尝试,你可以改变这一点。

所以你可以改变

代码语言:javascript
复制
encoding = "ascii" # Default value set by _PyUnicode_Init()

代码语言:javascript
复制
encoding = "utf-8" # Default value set by _PyUnicode_Init()

您还可以通过启用第一个if大小写来使用windows区域设置进行编码:

代码语言:javascript
复制
# Enable to support locale aware default string encodings.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41221254

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档