本文介绍了如何使i18next-node以正确的方式显示变音符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我进行了很多搜索,但是找不到解决我问题的方法.

I searched around quite a bit but couldn't find a solution for my problem.

我的应用程序使用i18next,除了一个问题之外,它都可以正常工作:德语变音符号(ü,ö,ä)显示为``.

My app uses i18next and it works fine except for one issue: german umlauts (ü,ö,ä) are displayed as �.

我不明白我是否理解错了,因为此示例应用程序的变音符没有问题: http://i18next-example1.eu01.aws.af.cm/?setLng=de-DE (github: https://github.com/rbeere/i18next-jade-express-sample )

I don't understand were I got it wrong, since this example app has no problem with umlauts: http://i18next-example1.eu01.aws.af.cm/?setLng=de-DE (github: https://github.com/rbeere/i18next-jade-express-sample)

我该如何解决这个问题?

How can I figure this one out?

推荐答案

罪魁祸首可能是:

meta(http-equiv="Content-Type",content="text/html; charset=utf-8")

  • Content-Type HTTP标头字段设置不正确.更改HTTP响应,如下所示:

  • Content-Type HTTP header field is not set properly. Change the HTTP response as follows:

    app.get('/', function(req, res) {
         res.header("Content-Type", "text/html; charset=utf-8");
         res.render('index', { title: 'Localization with Express, Jade and i18next-node'});
    });
    

  • 这篇关于如何使i18next-node以正确的方式显示变音符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!