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.
我正在动态添加输入标签的值。这些值是从服务器返回的,在某些情况下它们是 UTF8 编码的。长话短说,输入标签的值仍然保留编码字符,例如呈现Sábado给用户。
Sábado
在我的跨度标签中,该值根据需要呈现,这意味着输出了“Sábado”。我确实使用
<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
我怎样才能解决这个问题?
谢谢。
这些字符串不是“UTF8 编码”,而是HTML 实体。
不要 HTML 转义这些值。可能你在某个地方双重逃避它们。 如果没有有关您的代码的详细信息,很难给出更具体的建议。