HaxeFoundation / HaxeFoundation/haxe
[java vs js] StringTools.urlEncode/urlDecode behaves differently
Open
platform-java
test-disabled
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
In the java backend `StringTools.urlEncode` encodes characters like `~` `(` `)` and `'`, whereas the js backend doesn't.
`StringTools.urlDecode` also works differently for non-ASCII characters, in particular java replaces them with U+FFFD, and javascript throws an exception.
Our workaround was to override the java std StringTools with code taken from https://github.com/mozilla/rhino/ which replicates the js behaviour.
Check out https://github.com/exFalso/haxe-qc/ for a QuickCheck-based test for these functions alongside Std.parseX functions.
Contributor guide
Assessment
This issue has not been assessed yet.