[英]ASP.NET Site will not display Right Single quote correctly
I have an asp.net web site running on .net 4.0. 我有一个运行在.net 4.0上的asp.net网站。
The database is Firebird 2.1 and it is UTF-8. 该数据库是Firebird 2.1,它是UTF-8。
When a user enters the text O'Connell and saves it, when it is displayed on the web page it shows as O Connell instead. 当用户输入O'Connell文本并保存时,在网页上显示时将显示为O.Connell 。 The right quotation character is achieved by doing alt-0146.
右引号是通过执行alt-0146来实现的。
I know this is something to do with character encoding. 我知道这与字符编码有关。 I have done the following.
我已经做了以下工作。
1) Added <globalization culture="en-GB" uiCulture="en-GB" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
into the web.config file. 1)在Web.config文件中添加了
<globalization culture="en-GB" uiCulture="en-GB" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
。
2) Added <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
into the master page file. 2)将
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
到母版页文件中。
3) Ensured that all files on in the solution are encoded as 'UTF-8'. 3)确保解决方案中的所有文件都编码为“ UTF-8”。
4) Made sure I am connecting to the database with character set=UTF8;
4)确保我使用
character set=UTF8;
连接到数据库character set=UTF8;
in the connection string. 在连接字符串中。
I am at a loss to find out what the problem is? 我不知所措地找出问题所在?
Regards 问候
I think I am getting somewhere. 我想我要去某个地方。 I don't think it is the web site now.
我认为现在不是该网站。 I think it is the Firebird DB.
我认为是Firebird DB。 The data is stored in a VarChar(100) field type with no character set specified.
数据存储在VarChar(100)字段类型中,未指定任何字符集。 If I set the character set for the field to be UTF-8 it appears to work.
如果我将字段的字符集设置为UTF-8,它似乎可以工作。 I am pretty sure I read that if you don't specify a character set on the field but specify it in the connection string, then that overrides it.
我很确定我读过,如果您没有在字段上指定字符集,而是在连接字符串中指定了字符集,那么它将覆盖它。 It would appear not.
它似乎不会。 I will raise a question on this topic.
我将就这个话题提出一个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.