WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Why is IE doing this to me?

[Resolved] Why is IE doing this to me?

  • Hi,
    I translated the “no comments”, “1 comment” and “% comments” from my theme’s index.php file into Korean and encoded in UTF-8 before re-uploading it. It displays perfectly in FF but in IE the whole layout is moved towards the left side of the screen (IE does the same with my fGallery)
    Now the really nasty part is that IE still does it even though I changed back the translated terms to English!!
    Can anyone tell me why IE is doing this? How can I solve this? Does IE have a problem with UTF-8 encoding?
    My blog is here: http://www.raphaella.co.kr/blog
    The error the validator comes up with is the following:
    Error Line 1 column 0: character "" not allowed in prolog.

    ���<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www
    It’s the same error with my fGallery
    What is this error? How can I correct it?
    Help please!

Viewing 15 replies - 1 through 15 (of 19 total)
  • I don’t know in what editor did you edit your header.php file – but seemingly some weird characters were added at the beginning of that file (where the odd question marks appear above).
    Try to edit, remove…

    Well, I imagine this comes from this in my header.php:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    But there are no ?? marks in there so I don’t know what to do.

    And I downloaded the header.php file from my server and there are no ??marks in there either.
    What could be creating them?

    Thanks Moshu, one of the threads says that these BOM (byte order mark) can come in fact from the index php file that call the header. Mine is like this:
    <?php
    get_header();
    ?>

    I have some question marks there, so its probably them, no?
    Can I delete them without risking to cause havoc in my blog?

    If you have anything “nasty” before the code above – just delete it.

    I have nothing at all before that code.
    So I must not delete those question marks?

    What you posted that IS the code for calling the header.php. PHP code ALWAYS starts with
    <?php...
    and ends with
    ?>
    Do NOT delete those!

    You should search/google/ask: how to remove those BOM characters (which usually are invisible)

    But how can the html be different from the code I see in notepad++? Or how can I make that BOM visible? I can’t delete it if I can’t see it.

    Doodlebee

    @doodlebee

    Maybe try changing your charset to this:
    <meta http-equiv=”Content-Type” content=”text/html; charset=ISO-2022-KR” />

    When I valiadted your page by copying and pasting your code into the W3C validator (rather that putting in the URL), it validated just fine, but this message came up:

    “The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.”

    So it seems IE *does* have an issue with UTF-8 in some cases. (I googled a little on it.) But the above charset is for Korean text, so maybe specifying that will help?

    ok, I’ve just discovered in notepad++ the “convert to utf-8 without BOM” menu… but it’s greyed out and unselectable!!!

    PS problem solved, I could encode without BOM
    Thank you Moshu!!

    That’s the reason I adviced you to SEARCH. Why is so difficult to type in the google box
    “remove byte order mark”???
    and then going to read this:
    http://www.w3.org/International/questions/qa-utf8-bom

    Problem solved. Thanks Moshu. (who’s the guy who invented BOMs..)

    I also had the same problem with IE7. The design falled over to the left and the css had no effect until I manually reloaded the page. When running my pages trough The W3C Markup Validation Service it said there was a BOM in my files. I resaved the files, but with no luck. Then I checked my xmlrpc.php file, because I am doing almost all my posting from a home made desktop application. I found that if I took out this line:
    .setRequestHeader “Charset”, “utf-8”
    IE7 displayed my files perfectly.

    I still can’t find a way to delete the BOM characters after reading all of this. It tells me everything about what they are but exactly how do I delete them? Is there a specific editor that can make them visible, a script I can run to parse them or…?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘[Resolved] Why is IE doing this to me?’ is closed to new replies.