0

i wanted to test new django project in Visual Studio 2019. But when i add "ó" or "ą" character in template i get error "'utf-8' codec can't decode byte 0xf3 in position 280: invalid continuation byte"

My own project working well on VS Code. But this one premade by VS 2019 not.

{% extends "app/layout.html" %}

{% block content %}

<h2>{{ title }}.</h2>
<h3>{{ message }}</h3>

<address>
    One Microsoft Way<br />
    Redmond, WA 98052-6399<br />
    <abbr title="Phone">P:</abbr>
    425.555.0100
</address>

<address>
    <strong>Support: ó</strong>   <a href="mailto:Support@example.com">Support@example.com</a><br />
    <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@exampless.com</a>
</address>

{% endblock %}
RL89
  • 15
  • 8
  • I am not familiar with VS2019 but it looks like you should save your file in `utf-8` format. – Selcuk May 10 '19 at 02:52
  • Hello, thx for the suggestion. It works with one file, but how to change the whole project? – RL89 May 10 '19 at 06:50
  • You can, but you shouldn't. https://stackoverflow.com/questions/2276200/changing-default-encoding-of-python – amazonic May 10 '19 at 07:43
  • amazonic, I don't want to change anything in python itself. It looks like VS 2019 save everything in Central Europe windows 1250. If nothing helps, I will just save every HTML template and other files as utf-8 – RL89 May 10 '19 at 09:45
  • There are many questions that deal with the same question. Example: https://stackoverflow.com/questions/41335199/how-to-config-visual-studio-to-use-utf-8-as-the-default-encoding-for-all-project – Selcuk May 12 '19 at 23:07

1 Answers1

0

I know what's wrong with this. Everything is in right coding except HTML files so just save as utf-8 coding and everything works well.

RL89
  • 15
  • 8