tags:

views:

89

answers:

6

i am reading in html from a file and displaying it on a web page:

when i look at in the source i see:

The Club’s summer junior programs

but it shows up as:

The Club�s summer junior program

do you know whats happening here and why the � is shwowing up?

+2  A: 

Did you set the proper encoding of the html page?

Read here and here.

Davide Vosti
can you give me an example: i put:<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />at the top of the page but it made no difference
ooo
Didn't you have a fixed/not utf-8 character encoding set in your browser settings?This "bug" is presents in different machine? Do you have a public page we can see it?
Davide Vosti
A: 

This is definitely a character encoding issue. It means the page says it has X encoding, but actually it has Y.

Tamás Szelei
+1  A: 

I'm guessing you (or someone close to you) is copy/pasting from Word and you are seeing the webby effects of word's [not so] smart quotes. The work around is to set the character encoding to utf-8 or windows-1252.

Wyatt Barnett
how do i set character encoding
ooo
i tried adding: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />but no difference
ooo
A: 

A very interesting read by Joel: http://www.joelonsoftware.com/articles/Unicode.html about this topic, definitively a must read if you didn't already read this.

It explains pretty well why these problems occur, how they came to be and how to avoid it :).

Mythica
A: 

May be you have copied text from a work editor, like MS Word, which changes quotes to open quotes and closed quotes characters. When such a text is copied to a text file, it gives these problems.

A simple solution can be to type these quotes again in the text editor.

Mudit