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
Web Applications

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
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.
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
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
jimmysaunders

ASKER
@Gary. It already says <meta charset="UTF-8">.

Thanks,

JS
Your help has saved me hundreds of hours of internet surfing.
fblack61
Gary

Are they stored correctly in the DB? What encoding is being used in the DB?
jimmysaunders

ASKER
Yes. They are stored correctly in the database and the collation that the DB is using SQL_Latin1_General_CP1_CI_AS.
Dave Baldwin

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.