I am suppose to change some of these characters in English to Chinese in this setting.py
file but then error happened.
I know that it's saying because no encoding is declared in the error message but I have been reading a few posts and still have no idea how / where I can make it happen.
in my setting.py I have something like this
OSCAR_DASHBOARD_NAVIGATION = [
{
'label': _('dashboard'),
'icon': 'icon-th-list',
'url_name': 'dashboard:index',
},
but need to change the navigation to Chinese so ended up looking like this
OSCAR_DASHBOARD_NAVIGATION = [
{
'label': _('仪表板'),
'icon': 'icon-th-list',
'url_name': 'dashboard:index',
},
Edit, I already read the post which thought might be duplicated and tried what's in that post and instead of getting errors, I get a no show in my page but regarding to Pedru's answer. It works like a charm now.
In order to use non-ASCII characters, Python requires explicit encoding and decoding of strings into Unicode. In IBM® SPSS® Modeler, Python scripts are assumed to be encoded in UTF-8, which is a standard Unicode encoding that supports non-ASCII characters.
Non-ASCII characters are those that are not encoded in ASCII, such as Unicode, EBCDIC, etc. ASCII is limited to 128 characters and was initially developed for the English language.
\xe2 is the '-' character, it appears in some copy and paste it uses a different equal looking '-' that causes encoding errors. Replace the '-'(from copy paste) with the correct '-' (from you keyboard button).
Try adding
# -*- coding: utf-8 -*-
at the beginning of the file, make sure your file is really encoded in utf-8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With