WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Why is IE doing this to me? (20 posts)

  1. flush
    Member
    Posted 7 years ago #

    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!

  2. moshu
    Member
    Posted 7 years ago #

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

  3. flush
    Member
    Posted 7 years ago #

    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.

  4. flush
    Member
    Posted 7 years ago #

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

  5. moshu
    Member
    Posted 7 years ago #

  6. flush
    Member
    Posted 7 years ago #

    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?

  7. moshu
    Member
    Posted 7 years ago #

    If you have anything "nasty" before the code above - just delete it.

  8. flush
    Member
    Posted 7 years ago #

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

  9. moshu
    Member
    Posted 7 years ago #

    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)

  10. flush
    Member
    Posted 7 years ago #

    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.

  11. Doodlebee
    Member
    Posted 7 years ago #

    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?

  12. flush
    Member
    Posted 7 years ago #

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

  13. moshu
    Member
    Posted 7 years ago #

    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

  14. flush
    Member
    Posted 7 years ago #

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

  15. OlaD
    Member
    Posted 7 years ago #

    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.

  16. subtype
    Member
    Posted 7 years ago #

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

  17. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    subtype: Use some text editor that will let you remove them. It's really just that simple. Textpad, Notepad++, etc...

  18. subtype
    Member
    Posted 7 years ago #

    What's a good editor for mac that can do that?

  19. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    subtype: Dunno. Find somebody who uses a mac and ask them.

  20. subtype
    Member
    Posted 7 years ago #

    I figured someone here had brains enough to use a mac :P

    I have looked at this file in hex edit and EncodingMaster for mac and cannot see the characters... any idea? The error is:

    Line 2 column 0: character "" not allowed in prolog.

    ���<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3

    although my doctype starts n line one and there's no line breaks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.