【问题标题】:Change charset from utf-8从 utf-8 更改字符集
【发布时间】:2016-02-17 17:27:58
【问题描述】:

我最近开始学习 Angularjs 2,我在 Angular 1 方面没有太多经验,我正在关注their docs

我需要用巴西葡萄牙语书写,我通常会在我的 HTML 头部插入一个 iso-8859-1 字符集。当我在 Angular 结构中使用我的 html 时,字符集不再被识别。

这是我用来测试的示例。当我在 Angular 模板或其主索引中使用此 html 时,无法识别字符集。

<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="iso-8859-1">
    <title>João Paulo's site</title>
</head>
<body>
    <h1>João Paulo</h1>
    <h2>áéíóú ÁÉÍÓÚ çõ</h2>
</body>
</html>

【问题讨论】:

  • 如果个人喜好是这里唯一的因素,我建议你改一下。

标签: angularjs utf-8 character-encoding angular


【解决方案1】:

尽管我不知道为什么,但问题已经解决了。随着我的页面不断发展,我开始通过外部 json 文件加载页面的内容。

我仍然对 utf-8 和 iso-8859-1 感到困惑,但解决问题的方法是让 html 页面字符集为 utf-8,我必须将 json 文件保存为 iso-8859-1。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-22
    • 1970-01-01
    • 1970-01-01
    • 2012-01-14
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 2013-05-26
    相关资源
    最近更新 更多