简体   繁体   中英

ASP.NET Site will not display Right Single quote correctly

I have an asp.net web site running on .net 4.0.

The database is Firebird 2.1 and it is 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. The right quotation character is achieved by doing 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.

2) Added <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> into the master page file.

3) Ensured that all files on in the solution are encoded as 'UTF-8'.

4) Made sure I am connecting to the database with 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. The data is stored in a VarChar(100) field type with no character set specified. If I set the character set for the field to be UTF-8 it appears to work. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM