Character encoding

M

Mambo Bananapatch

I'm preparing a site for a client which includes several pages
containing Cyrillic characters. I used the UTF-8 charset, but the
Cyrillic characters appeared as question marks (and, oddly, some
Chinese characters as well.) I tried every Cyrillic charset I could
find and nothing worked.

I usually just hand-code all my PHP and HTML, but I swallowed hard and
went to Dreamweaver CS3, searched around, and found that I could set
each file's encoding to UTF-8 using the Modify => Page Properties =>
Title/Encoding command.

Now it works fine, but I don't really understand what the command did.
It didn't add any code, and it didn't change the http-equiv tag. In
fact, I have to perform the command on every file that is included in
the PHP file.

So: a) what exactly did Dreamweaver do, and b) how could I have hand-
coded whatever it is?

Thank you in advance.
 
J

Jukka K. Korpela

Scripsit Mambo Bananapatch:
I'm preparing a site for a client which includes several pages
containing Cyrillic characters.

You should have posted the URL of at least one of the several pages.
I used the UTF-8 charset,

Did you? Do you know that for sure? We cannot, in lack of a URL.
but the
Cyrillic characters appeared as question marks (and, oddly, some
Chinese characters as well.)

There's nothing odd in that if the declared encoding ("charset") does
not match the actual encoding.
I tried every Cyrillic charset I could
find and nothing worked.

Why did you try Cyrillic "charsets" if you used UTF-8?
I usually just hand-code all my PHP and HTML, but I swallowed hard and
went to Dreamweaver CS3, searched around, and found that I could set
each file's encoding to UTF-8 using the Modify => Page Properties =>
Title/Encoding command.

So you fixed the problem? You could have said it first. Now I spent my
daily problem-solving quota in trying to understand what your problem
is.

If that changes the actual encoding, as I suspect, then it's not really
a mindshaking surprise that it fixes the problem caused by the mismacth.
Now it works fine, but I don't really understand what the command did.

What did the program's manual say?
 
M

Mambo Bananapatch

You should have posted the URL of at least one of the several pages.

You're quite right, of course. My apologies. Here it is.
http://www.sabrehealth.com/brokers/tatyana_subbotina/home_rus.php

....
Why did you try Cyrillic "charsets" if you used UTF-8?

Because when I manually coded:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

....it didn't work. All I got were question marks in place of Cyrillic
characters. Until I encoded each included file, it didn't matter what
charset I used. (Incidentally, why do you place "charsets" in quotes?
Have I used the term incorrectly? I confess to knowing very little
about this area, this being my first multilingual attempt at HTML.)
So you fixed the problem? You could have said it first. Now I spent my
daily problem-solving quota in trying to understand what your problem
is.

You could have read down to the second paragraph, where I stated the
fact quite plainly.
What did the program's manual say?

Simply that I could change the page's encoding by way of the
Modify=>Page properties=>Title/Encoding command. I assumed --
incorrectly, obviously -- that this only applied to the section of the
page that included the <meta http-equiv...> tag, which I had already
set to UTF-8. (I still don't understand why that didn't work.)

I didn't realize that I had to perform the command on each file that
was to be included in the entire page, which is the essence of my
question. Why do I have to encode, for example, header.php, nav.php,
content.php, footer.php, etc.? I was under the impression that the
<meta http-equiv...> tag would encode the entire page.

So, if I were on a remote island and didn't have Dreamweaver and had
to hand-code, say, footer.php, to accomplish this encoding, how would
I go about it?

Thank you for your time Mr. Korpela.
 
H

Harlan Messinger

Mambo said:
You're quite right, of course. My apologies. Here it is.
http://www.sabrehealth.com/brokers/tatyana_subbotina/home_rus.php

...



Because when I manually coded:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

This is a fallback. If the web server sends a Content-Type HTTP header
with a charset other than UTF-8, the META tag will have no effect.
...it didn't work. All I got were question marks in place of Cyrillic
characters. Until I encoded each included file, it didn't matter what
charset I used. (Incidentally, why do you place "charsets" in quotes?

As the http-equiv attribute indicates, this kind of META tag is meant to
serve in lieu of an actual HTTP header if one wasn't sent. The actual
header looks something like:

Content-type: text/html; charset=UTF-8

The content attribute of the META tag contains the content (value) of
the Content-type header in quotes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top