Closed Bug 143556 Opened 23 years ago Closed 22 years ago

JavaScript escape/unescape doesn't work properly with surrogate characters

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.2beta

People

(Reporter: amyy, Assigned: shanjian)

References

Details

(Keywords: intl, topembed)

Build: 05-09 1.0.0 branch build.

Go to: http://babel/JavaScript_i18n/SimpChinese/escape_UTF8.html
Notice the last surrogate character is displayed as "??" - I expected it will
show the original character.  Not sure if caused by escape() or unescape().

If you view the page source, the original charcter is diplayed correctly before
escaped.
Change component to Java Engine for now.
Component: Internationalization → JavaScript Engine
Keywords: intl
QA Contact: ruixu → ylong
surrogate support -> shanjian
Assignee: yokoyama → shanjian
Blocks: 157673
mark it as nsbeta1+ for m1.2final. tm=m1.2beta
Keywords: nsbeta1+
Target Milestone: --- → mozilla1.2beta
There is a mistake in the testcase. 
y1="unescaped%E4%B8%AD%E9%97%B4%E6%9C%89%20%E7%A9%BA%E7%99%BDsurrogate%F0%90%80%84"
should be 
y1="unescaped%E4%B8%AD%E9%97%B4%E6%9C%89%20%E7%A9%BA%E7%99%BDsurrogate%F0%A0%80%84"

Once I correct this, everything works fine. 
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
I don't see the difference between the wrong one and correct on in previous
comment.  What's it?
9 or 10 characters from the right you'll see a '9' on top line and an 'A' on the
bottom line
Thanks!  I have correct my test case.

Then is the problem should be escape() the surrogate characters? although
unescape() seems doesn't has a problem?
I could not see anything wrong with my local build. I talked to ylong about this
bug. It sounds like some other problem caused the wrong escape output. I guess
it is the utf8 conversion, which has been fixed in my local tree. I will keep
this open until I check in my other surrogate fixes.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Status: REOPENED → ASSIGNED
utf8 converting problem fixed. mark this one as fixed. Please verify.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
batch: adding topembed per Gecko2 document
http://rocknroll.mcom.com/users/marek/publish/Gecko/Gecko2Tasks.html
Keywords: topembed
Still see the surrogate character is not escaped correctly ( %F0%90%80%84
instead of %F0%A0%80%84) on 09-12 trunk build / WinXP-SC.

Re-open.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I tried it on 2002100409 build, and it works fine now. I guess one of the UTF8
is still not checked in when I close this bug. 
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
Verified fixed in latest trunk build.
Status: RESOLVED → VERIFIED
Blocks: grouper
Depends on: 180372
No longer blocks: 157673
You need to log in before you can comment on or make changes to this bug.