WordPress.org

Ready to get started?Download WordPress

Forums

2.5.1 Adding  To end of words, mostly italics and spaces? (18 posts)

  1. AldebaranJill
    Member
    Posted 6 years ago #

    Hi,
    Here's the situation. The only way we can duplicate this is by writing things in italics. If we do, at the end of some words, we get the  symbol...but here's the kicker, it only shows up on the blog's index page and NOT at the post page.

    The website, blog, database is all set to UTF-8, I've triple checked.
    In the wp-config.php it does NOT have the collate lines at all, so that's not it (seems like commenting them out fixes other people's issues, but those two lines aren't even here)

    We're using 2.5.1.

    Any help is appreciated.
    Jill

  2. AldebaranJill
    Member
    Posted 6 years ago #

    Another piece of information: I went and looked inside the database and it was there. It looked like this <em>Â</em>.

  3. AldebaranJill
    Member
    Posted 6 years ago #

    I'm praying that Moshu looks at this..

    Hey Moshu,
    I found this: http://wordpress.org/support/topic/144841?replies=4
    Is it possible double spaces are causing this? So far the samples I've seen were indeed after periods.

  4. augnix
    Member
    Posted 6 years ago #

    I have the same problem with 2.6.

    It's easy to reproduce too:

    * Create new post.
    * Use the "visual" editor.
    * End your first sentence with a period (.) followed by two spaces.
    * Begin and end another sentence.

    If your character encoding on your browser is set to Unicode (UTF-8) you will see the two spaces after the period, but if you change it to Western (ISO-8859-1) you will see the funny A character (Â).

    The funny A character makes it into the 'post_content' variable and into the DB; I have a custom plug-in I use to notify customers of new posts and the funny A gets sent out in those messages too.

    Note: if you re-save your post, the funny A character goes away in your published post.

    My Browser info.:
    Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080703 Mandriva/2.0.0.16-1.1mdv2008.0 (2008.0) Firefox/2.0.0.16

  5. augnix
    Member
    Posted 6 years ago #

    I re-opened this ticket in response to this thread:

    http://trac.wordpress.org/ticket/6942

  6. augnix
    Member
    Posted 6 years ago #

    In a related ticket ( http://trac.wordpress.org/ticket/6562 ) I found this code snippet:

    $text = preg_replace("/[^\x20-\x7f\t\n\r]+/", "", $text); // ascii only

    That worked great in my custom plug-in for stripping out those non-ASCII characters.

  7. timarmes
    Member
    Posted 5 years ago #

    Hi,

    This problem is driving me crazy. I sat down last night to try to understand it.

    Now, when I choose to use the default theme the problem goes away. That is, when I view an existing post with these strange characters the post looks correct.

    When I use my own theme, which is heavily based on the default theme, the very same post shows the odd characters.

    I assumed that there was simply some charset issue with my theme, but no - the header is the same between the two. Furthermore, WordPress itself fills in the charset information for the content-type, and it uses UTF-8 for both themes.

    However, when WordPress writes out the post to my theme, it writes it with the strange characters - I can see them in the generated source. When it writes the post to the default theme it doesn't.

    So for some reason it seems that it's changing the output encoding when writing the post to my template, but I have no idea why. I've tried to track it down but it's hard to know where to look.

    Please let me know if there's anything I can do to help track this problem down.

    Tim

  8. Dinmyer
    Member
    Posted 5 years ago #

    I've got two blogs that were exposed to this defect in the latest upgrade. I'd love to see a solution soon (with more understandable steps to fix).

  9. timarmes
    Member
    Posted 5 years ago #

    Just to let you know that I've upgraded to 2.7.

    I took the 2.7 default theme and made a few changes, and once again the problem had come back.

    Please, I'll do anything I can to help get this fixed.

    Tim

  10. timarmes
    Member
    Posted 5 years ago #

    OK, I've found it.

    It's taken me hours to track it down, but it turns out that my head code called another library function to set up the locale, and this in turn used the PHP header() thusly:

    header("Content-Type: text/html; charset=ISO-8859-15");

    And that broke stuff. No idea why two spaces should be converted to an accented character, but in any case changing this to UTF-8, as it should be, solved the problem.

    Tim

  11. shields
    Member
    Posted 5 years ago #

    Tim -- can you be more specific on your fix? It sounds like you replaced some PHP code in the theme? Which file? Which code? Thanks.

  12. dirtnyureye
    Member
    Posted 5 years ago #

    Shields, not to speak for Timarmes, but look at your theme's header.php ...where the meta tag is declared. Make sure the charset= field is set to utf-8. In my theme, it's grabbing the charset field from the WordPress Admin --> Settings --> Reading --> "Encoding for pages and feeds" field by using the following code in the header.php

    Charset field by using the following code

    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

  13. dirtnyureye
    Member
    Posted 5 years ago #

    By the way, I also have this weird character problem and am looking for a solution. How come no one representing wordpress knows anything about this? This problem seems pretty systemic... And all these weird characters happened after I upgraded from 2.6.7 to 2.7.0.

  14. timarmes
    Member
    Posted 5 years ago #

    The problem was in my customised theme.

    I called out to my own header code that I use on the rest of my site, and this set up the locale which in turn sent the header that I described above.

    The header's are part of the HTTP protocol, not the HTML protocol, so they're not seen in the page source. My page source was using UTF-8, but the header was set as ISO-8859-15, and this inconsistancy was the cause of the problems.

    Tim

  15. soonerfaninks
    Member
    Posted 5 years ago #

    Where is the header file someone? I am trying...

  16. soonerfaninks
    Member
    Posted 5 years ago #

    I see my header calling bloginfo but I have no idea where that is...

  17. soonerfaninks
    Member
    Posted 5 years ago #

    In case someone else has this problem here is the solution I found with the help of "silva" on the wordpress irc channel:

    Check you wp_config.php file. Open it with text editor. Down a way (about 61 lines) you will see:

    define('DB_CHARSET', 'utf8');

    change it to:

    define('DB_CHARSET', 'latin');

    upload and see if that works for you.

  18. augnix
    Member
    Posted 5 years ago #

    Or do this :

    http://codex.wordpress.org/Converting_Database_Character_Sets

    But seriously; Jebus help you if you have to do that.

Topic Closed

This topic has been closed to new replies.

About this Topic