Character encoding

Discussion in 'HTML' started by Mambo Bananapatch, Apr 26, 2008.

  1. 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.
    Mambo Bananapatch, Apr 26, 2008
    #1
    1. Advertising

  2. 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/
    Jukka K. Korpela, Apr 26, 2008
    #2
    1. Advertising

  3. On Apr 26, 8:59 am, "Jukka K. Korpela" <> 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/tatyana_subbotina/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.
    Mambo Bananapatch, Apr 26, 2008
    #3
  4. Mambo Bananapatch wrote:
    > On Apr 26, 8:59 am, "Jukka K. Korpela" <> 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/tatyana_subbotina/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.
    Harlan Messinger, Apr 29, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harley

    foreign character encoding

    Harley, Jul 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,976
    Harley
    Jul 26, 2003
  2. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,780
    Jon Skeet [C# MVP]
    Jun 9, 2004
  3. Replies:
    1
    Views:
    23,298
    Real Gagnon
    Oct 8, 2004
  4. raavi
    Replies:
    2
    Views:
    888
    raavi
    Mar 2, 2006
  5. Replies:
    2
    Views:
    347
Loading...

Share This Page