Closed Bug 660798 Opened 13 years ago Closed 13 years ago

[ECMAScript5]decodeURI/decodeURIComponent should throw URIError for overlong UTF-8

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: masa141421356, Unassigned)

References

Details

According to ECMAScript5 Specification, decodeURI() and decodeURIComponent() should throw URIError for invalid percent-encoded UTF-8 sequences.

According to RFC3629, overlong UTF-8 sequences is INVALID (For example, "%C0%80").

But Rhino returns U+FFFD for overlong UTF-8 sequence.

Expected Result:
  decodeURIComponent("%C0%80") should throw URIError
Actual Result:
  decodeURIComponent("%C0%80") returns "\uFFFD"

See also : bug 514760 (Same bug of SpiderMonkey)
Blocks: 489326
Should also be fixed by my patch for bug #660799:

https://github.com/mozilla/rhino/commit/879940b9f51be52c8a08f5e94ee9c81f590e2b07
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.