Skip to content

[java vs js] StringTools.urlEncode/urlDecode behaves differently #4564

Open
@exFalso

Description

@exFalso

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions