Bug 18769 - replacing   with spaces using regexp creates inconsistent result
Summary: replacing   with spaces using regexp creates inconsistent result
Status: RESOLVED DUPLICATE of bug 11947
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2008-04-27 02:02 PDT by Joshua
Modified: 2008-05-05 00:15 PDT (History)
2 users (show)

See Also:

Test case for the problem (322 bytes, text/html)
2008-05-03 03:24 PDT, Joshua
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua 2008-04-27 02:02:57 PDT
Replacing all ' ' with ' ' in a text using regexp object, replaces the ' '  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 ***