Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在用法语创建我的 odoo 模块时尝试使用重音。在我的 xml 文件中,我有: UTF-8 编码,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
但是当我使用口音时,代码总是会产生错误!
您的 XML 编码看起来不错(与核心中使用的相同,例如l10_fr模块)
l10_fr
<?xml version="1.0" encoding="utf-8"?>
这让我相信您可能需要在 Python 端设置编码。除了在文件顶部指定编码之外,您不需要做任何事情:
# -*- coding: utf-8 -*-