Closed Bug 195946 Opened 18 years ago Closed 16 years ago

Form controls convert NBSP to SP

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 218277

People

(Reporter: sewellpm, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4a) Gecko/20030304
Build Identifier: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4a) Gecko/20030304

When a non-breaking space character (NBSP, 0xa0) is entered into a form control,
it is converted into a normal space (SP, 0x20).  

Because of this, a legal JavaScript string can change value when it is pasted
into a form for analysis.

This behavior was not present in Mozilla 4.

Reproducible: Always

Steps to Reproduce:
1.  Load this sample HTML:

<form onsubmit="return false">
<input name="Source" size="20" value="keep&nbsp;together">
<input type="submit" onclick="Target.value=escape(Source.value)">
<input name="Target" size="20">
</form>

2.  Press the button.  The Target text control displays a URL-encoded copy of
the Source control.
Actual Results:  
Target reads "keep%20together".

Expected Results:  
Target should read "keep%A0together".
*** Bug 213924 has been marked as a duplicate of this bug. ***
Confirmed using http://www.squarefree.com/htmledit/ in Firebird 07/23.  Also
happens with &#0160; in place of &nbsp;.  Also happens if you copy the nbsp out
of the form.  (But ctrl+left / ctrl+right shows that the text in the form has a
non-breaking space.)
Status: UNCONFIRMED → NEW
Ever confirmed: true
This seems to be the same problem as bug 218277 which is being resolved with a
patch.
Bug confirmed with Firebird 0.7+ 20031106

I tested with my own Mozilla version with the patch I submitted for bug 218277
It worked fine then. I got keep%A0together. So bug 195946 and bug 218277 will be
both resolved with the patch (id=136358).
Depends on: 218277

*** This bug has been marked as a duplicate of 218277 ***
Status: NEW → RESOLVED
Closed: 16 years ago
No longer depends on: 218277
Resolution: --- → DUPLICATE
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.