0
Greetings to all.
I am trying to render an html file with Python/Django and am getting error "'utf-8' codec can’t Decode byte 0xe1 in position" because of a sharp comment.
The problem wouldn’t be serious if I didn’t need to show comments and descriptions in the fields that will be filled by users.
I’ve tried to include it in the code: {% include "base/js.html, encoding='latin-1', engine='python'" %}
but the error persists and all references I found on this site or in others only tell how to read a file in csv format (which is not my case).
I humbly ask for your help in solving this problem that is impaling me.
Thanks so much for all the help I get.
Try putting
# encoding: utf-8
at the beginning of the file that has these comments– Miguel
Good morning, Miguel and thank you for your suggestion. I entered the line and it did not work. The error persists. Currently the CSS.HTML file has the following content: {% load Static %} # encoding: utf-8 <! -- Reader of the base.html style page --> <link rel="stylesheet" href="{% Static 'css/main.css' %}" <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">#Xa;<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
– HPaz
Take a look here: https://wiki.python.org/moin/UnicodeDecodeError
– Carlos Cortez