Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Character encoding (http://www.velocityreviews.com/forums/t607664-character-encoding.html)

Mambo Bananapatch 04-26-2008 01:38 AM

Character encoding
 
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.

Jukka K. Korpela 04-26-2008 12:59 PM

Re: Character encoding
 
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?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Mambo Bananapatch 04-26-2008 07:43 PM

Re: Character encoding
 
On Apr 26, 8:59 am, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:

> 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/t...a/home_rus.php

....

> > I tried every Cyrillic charset I could
> > find and nothing worked.


> 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.)

> > 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.


You could have read down to the second paragraph, where I stated the
fact quite plainly.

> > Now it works fine, but I don't really understand what the command did.

>
> 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.

Harlan Messinger 04-29-2008 01:20 PM

Re: Character encoding
 
Mambo Bananapatch wrote:
> On Apr 26, 8:59 am, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
>
>> 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/t...a/home_rus.php
>
> ...
>
>>> I tried every Cyrillic charset I could
>>> find and nothing worked.

>
>> 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" />


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.


All times are GMT. The time now is 01:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.