带有德语文本的页面(Django/python)

2024-04-25 05:07:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个简单的HTML页面,用德语向用户提供信息,其中包含äüö等字符

我得到以下错误:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 795: invalid start byte

有人知道怎么解决这个问题吗?你知道吗

示例:

{% extends 'base.html' %}
{% block title %}{{ block.super }}{% endblock %}

{% load static from staticfiles %}

{% block content %}

<div class="page">
<div class="content wide">
    <h1>Title</h1>
        <div class="txt">
        Some text in German containing ä, ö, ü, ß ...
        </div>
</div> <!-- end content -->
</div>

{% endblock %}

例如,这是一个放在页脚的Impressum页面。你知道吗


Tags: 用户indiv信息html错误页面content