[wp-trac] Re: [WordPress Trac] #6942: typing two spaces in visual editor creates  characters in displayed post

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 5 17:01:40 GMT 2008


#6942: typing two spaces in visual editor creates  characters in displayed post
-------------------------------+--------------------------------------------
 Reporter:  meonkeys           |        Owner:  anonymous
     Type:  defect             |       Status:  reopened 
 Priority:  normal             |    Milestone:           
Component:  TinyMCE            |      Version:  2.6      
 Severity:  normal             |   Resolution:           
 Keywords:  reporter-feedback  |  
-------------------------------+--------------------------------------------
Comment (by augnix):

 Replying to [comment:7 azaozz]:
 > Let me get the steps to reproduce this right:
 > - go to the write page and type 2 sentences while your browser is set to
 UTF-8.

 Yes, and put two spaces after the first period.

 > - save the post still in UTF-8 or are you switching the encoding in the
 middle of typing?

 Yes. UTF8 all the way through.

 > - view the post on the site and force the browser to display it in
 ISO-8859-1.
 > At this point any UTF-8 chars would show as broken. That seems to be the
 standard browser behavior. Forcing to view a web page in different
 encoding would break some chars. All browsers have charset auto-detection,
 so even if the charset isn't set in the header, they still display the
 text correctly. The same happens in the editor iframe.
 > Couldn't reproduce this in Firefox 3. It was switching back to UTF-8 and
 displaying the text correctly.

 I know it's a pretty trivial bug, but if you look around at the forums it
 pops up a few times and causes confusion:

 http://wordpress.org/support/topic/187662
 http://wordpress.org/support/topic/144841

 Also, the editor is putting these characters into the DB; which could
 cause problems for people down the line (even though they should know
 everything is UTF8).

 The real question though is, why does the editor turn a double space into
 something else?

 > If you have problems in your custom plugin, perhaps use the solution
 from #6562 to filter out the Unicode for nbsp, although it's a valid HTML
 character.

 This is what I ended up doing; other plug-in writers are probably going to
 have to take similar measures.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6942#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list