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

Joshua
Reported 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.
Attachments
Test case for the problem (322 bytes, text/html)
2008-05-03 03:24 PDT, Joshua
no flags
Mark Rowe (bdash)
Comment 1 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?
Joshua
Comment 2 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.
Joshua
Comment 3 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.
Alexey Proskuryakov
Comment 4 2008-05-05 00:15:33 PDT
*** This bug has been marked as a duplicate of 11947 ***
Note You need to log in before you can comment on or make changes to this bug.