Link to home
Avatar of jimmysaunders
jimmysaunders

asked on

Fancy quotes in HTML

Hi,

I have a C# application spitting out some text from SQL Server database. My problem is with displaying words enclosed in opening and closing quotes. For example, “Stigma” is being displayed as  ¿Stigma¿ and Can’t say is being displayed as Can¿t say.

What do I need to replace in the InnerHTML and with what?

Thanks
Avatar of jimmysaunders
jimmysaunders

ASKER

Clarification, in my browser, the inverted question marks are not what being displayed. They just show on this website and not what I typed in my original question). What I copied were question marks in a black diamond shape.
Avatar of Gary
Make sure you have in the HEAD

HTML5
<meta charset="UTF-8">

or HTML4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
@Gary. It already says <meta charset="UTF-8">.

Thanks,

JS
Are they stored correctly in the DB? What encoding is being used in the DB?
Yes. They are stored correctly in the database and the collation that the DB is using SQL_Latin1_General_CP1_CI_AS.
SQL_Latin1_General_CP1_CI_AS
As I said, Latin1.  Which is Not UTF-8.  Both characters sets are identical for the ASCII lower 127 characters but above that, they are different.  While 'Smart quotes' are available in UTF-8, they use different character (binary) code to represent them.  Someone posted a list of programs that can translate from Latin1 to UTF-8 but I can't find it at the moment.