在asp.net MVC视图显示正确的法国口音不 [英] French accent not shown correctly in asp.net MVC view

查看:143
本文介绍了在asp.net MVC视图显示正确的法国口音不的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net MVC视图接收一个强类型的模型:

I have an ASP.Net MVC View receiving a strongly typed model:

@model MyApp.Models.MyModel

在显示该模型的属性的值,

When displaying properties values of this model,

例如: @ Html.DisplayFor(型号=> model.myFrenchProperty)

法国字符不会在浏览器中正确显示。

french characters are not shown correctly in browser.

例如法语单词一般显示为浏览器的嘎©NA©拉尔。

For example the french word "Général" is shown as "Général" in browser.

我也尝试使用@ Html.Raw(Model.myFrenchProperty),但没有改变。

I have try using @Html.Raw(Model.myFrenchProperty) but nothing change.

我的模型是建立与实体框架和数据来自一个UTF-8 EN codeD数据库。

My model is built with Entity Framework and data come from an UTF-8 encoded database.

不知道如何使这项工作正常?

Any idea how to make this work properly?

推荐答案

我使用的是Devart连​​接PostgreSQL数据库,问题是具体到这个设置...我的问题解决了加入统一code = true在连接字符串...似乎有一个UTF-8配置的数据库是不够的......

I'm using PostgreSQL database with Devart connector and the problem was specific to this setup... My problem was solved adding Unicode=true in the connection string... It seems that having an UTF-8 configured database is not enough...

艾蒂安

这篇关于在asp.net MVC视图显示正确的法国口音不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆