additional characters appearing in text

The editor is adding in odd characters in my FAQ answers such as "Â Â" - mostly at the end of sentences after a period - but other times they appear mid-sentence.

  • antKat
    • HummingBird

    We ran the multi-db with maximum 4,096 databases. Which database(s) do I need to check? Since, we are having problem now with the FAQ which I assume gets written to the main database - would that be sufficient? We did not see any problem like this prior to multi-db. After the process, our template site text had a conversion problem with ("") and ( ') which I edited out and new sites do not have a problem. The FAQ is the first time since that I am seeing this.

  • thinkmarketact
    • Site Builder, Child of Zeus

    I'm having the same issue an  is all over the place and will not go away.

    It is most commonly at the following locations of design or html view

    Before and after a , i.e  , Â
    after <strong> i.e. </strong><strong>Â
    after  i.e. Â

    i have a bunch of plugins but this started happening 5 seconds after i ran move-blogs.php

    i have a wordpress multi site no buddypress
    this is happening on the super admin site only

    after checking the global db....

    i have a mixture of utf8_general_ci and utf8_unicode_ci
    and the  is NOT in the wp_posts table on

  • antKat
    • HummingBird

    The problem we are having is not just limited to FAQ - but they now seem to be limited to the main site. Here is an example, I just installed/activated the Global Posts Widget as a test; the posts on the multi-sites are fine but there is a character on the main site displaying the posts in the sidebar.

  • Barry
    • DEV MAN’s Mascot

    this is happening on the super admin site only

    What is the difference between the main site and the sub-sites in your database? Can you check the encoding of your posts table in the database?

    Also, I note the screenshot is for the Recent Global Posts widget? Do you see the same characters in the original posts on the sites/blogs that those posts are from?

  • thinkmarketact
    • Site Builder, Child of Zeus

    What is the difference between the main site and the sub-sites in your database? Can you check the encoding of your posts table in the database?

    The encoding for is utf8_general_ci
    when i delete db.php and db-config from wp-contents everything goes back to normal

    i googled it and everyone says this happens when the encoding is set to something BESIDES utf8_general

    @barry - you replied to my other thread on this....
    https://premium.wpmudev.org/forums/topic/multi-db-not-working#post-140006

    that is working now but i just remembered that these A's didnt show up for me before but before i forgot to set the global db in db-config.on line 25 i think it was?

    if you think it would help i can delete all my databases and re-run move blogs with out a global and see if it still happens, i dont think it will though.

  • antKat
    • HummingBird

    Barry,
    In regards to your question regarding the screenshot for the Recent Global Posts widget; the answer is that the characters are NOT showing up in the original posts on the sites/blogs that those posts are from.

    We have had this character problem showing up since we did the multi-db. Through some of the responses on the forum we have implemented the following - bust as you see, it does not completely solve the problem:

    7) For Character issue:
    we have modified the code: According to our search and forum reply

    if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
    if ( function_exists( 'mysql_set_charset' ) ) {
    mysql_set_charset( $this->charset, $this->dbhglobal );
    $this->real_escape = true;
    } else {
    $query = $this->prepare( 'SET NAMES %s', $this->charset );
    if ( ! empty( $this->collate ) )
    $query .= $this->prepare( ' COLLATE %s', $this->collate );
    $this->query( $query );
    }

    by this
    mysql_query('SET NAMES UTF8');
    mysql_query("SET CHARACTER SET utf8");
    mysql_query('SET COLLATION_CONNECTION=utf8_general_ci');

  • antKat
    • HummingBird

    Barry,
    I have cheeked the back end, encoding for posts table is "utf8_general_ci".
    The difference between the main site and sub site is that, main site has "global" database and the sub site has efferent database(From other 4096 databases).

  • Mustafa
    • Syntax Hero

    Hiya,

    Can you try this (line 207)

    if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
    			if ( function_exists( 'mysql_set_charset' ) ) {
    				mysql_set_charset( $this->charset, $this->dbhglobal );
    				$this->real_escape = true;
    			} else {
    				$query = $this->prepare( 'SET NAMES %s', $this->charset );
    				if ( ! empty( $this->collate ) )
    					$query .= $this->prepare( ' COLLATE %s', $this->collate );
    				$this->query( $query );
    			}
    		}
    
    //add this lines
    mysql_query('SET NAMES UTF8');
    		 mysql_query("SET CHARACTER SET utf8");
             mysql_query('SET COLLATION_CONNECTION=utf8_general_ci');

    I hope that's help.

  • Mustafa
    • Syntax Hero

    @antKat Did you try previous post?
    I get same error before and deal with this way.If you remove

    if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
    			if ( function_exists( 'mysql_set_charset' ) ) {
    				mysql_set_charset( $this->charset, $this->dbhglobal );
    				$this->real_escape = true;
    			} else {
    				$query = $this->prepare( 'SET NAMES %s', $this->charset );
    				if ( ! empty( $this->collate ) )
    					$query .= $this->prepare( ' COLLATE %s', $this->collate );
    				$this->query( $query );
    			}
    		}

    part only you'll get error with pro-sites.So replace with

    if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
    			if ( function_exists( 'mysql_set_charset' ) ) {
    				mysql_set_charset( $this->charset, $this->dbhglobal );
    				$this->real_escape = true;
    			} else {
    				$query = $this->prepare( 'SET NAMES %s', $this->charset );
    				if ( ! empty( $this->collate ) )
    					$query .= $this->prepare( ' COLLATE %s', $this->collate );
    				$this->query( $query );
    			}
    		}
    
    mysql_query('SET NAMES UTF8');
    		 mysql_query("SET CHARACTER SET utf8");
             mysql_query('SET COLLATION_CONNECTION=utf8_general_ci');

    Cheers,

  • antKat
    • HummingBird

    Mustafa, thank you for trying to help. As you can see from my remark 4 entries previous, we have already implemented your code change. Unless I am missing something, your new code suggestion is the same as what we have already tried. Do you see a difference?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.