Bug 18769

Summary: replacing   with spaces using regexp creates inconsistent result
Product: WebKit Reporter: Joshua <admin>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Major CC: ap, mrowe
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Test case for the problem none

Description Joshua 2008-04-27 02:02:57 PDT
Replacing all '&nbsp;' with ' ' in a text using regexp object, replaces the '&nbsp;'  with extended ascii charecter 160 which is \u0A0.  It should replace them with ascii 32. 

I think &nbsp is considered as a single character when used with regexp object which should not be the case.
Comment 1 Mark Rowe (bdash) 2008-04-27 17:40:15 PDT
U+00A0 is the code point of the non-breaking space, which suggests to me that no replacing is going on.  Can you please attach an example of code that does not work as you expect?
Comment 2 Joshua 2008-05-03 03:24:59 PDT
Created attachment 20946 [details]
Test case for the problem

The additional interesting thing is that putting couple of carriage returns after the </body> tag is included in document.body.innerHTML. May be a separate bug though.
Comment 3 Joshua 2008-05-03 03:26:20 PDT
As you can see from the test case the '&nbsp;' is replaced with character code 160. It should have been all 32.
Comment 4 Alexey Proskuryakov 2008-05-05 00:15:33 PDT

*** This bug has been marked as a duplicate of 11947 ***