Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Unify http- and percent- encode/decode" #18156

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

RandomShaper
Copy link
Member

This reverts commit b76ee30.

The reverted commit is the one from #17583 that has caused some trouble.

@RandomShaper RandomShaper added this to the 3.1 milestone Apr 12, 2018
@RandomShaper RandomShaper mentioned this pull request Apr 12, 2018
@akien-mga akien-mga merged commit e7e9d9a into godotengine:master Apr 13, 2018
@RandomShaper RandomShaper deleted the fix-messed-pr branch April 16, 2018 16:56
@aaronfranke
Copy link
Member

@RandomShaper @akien-mga Can the removal of the percent_ methods be re-evaluated for 4.0? I can't reproduce any issues with this, the only difference that I can see is that one uses uppercase letters and the other uses lowercase letters.

	print("Ж Godot Engine:'docs'".percent_encode())
	print("Ж Godot Engine:'docs'".http_escape())
	print("Ж Godot Engine:'docs'".percent_encode().percent_decode())
	print("Ж Godot Engine:'docs'".http_escape().http_unescape())
	var http = HTTPClient.new()
	var dic = { 'arg1' : 'Ж', 'arg2' : 'foo' }
	print(http.query_string_from_dict(dic))

Output:

%d0%96%20Godot%20Engine%f0%9f%99%82%3a%27docs%27
%D0%96%20Godot%20Engine%F0%9F%99%82%3A%27docs%27
Ж Godot Engine:'docs'
Ж Godot Engine:'docs'
arg1=%D0%96&arg2=foo

For #17583, it seems that the only reason these were kept is because of GDNative compatibility. If that was the concern, then a wrapper method should've been kept instead of keeping a duplicate method in core. However, we have the opportunity to break compatibility with GDNative for Godot 4.0.

@akien-mga
Copy link
Member

This could be redone yes, or even back to the original implementation which unified those as uri_encode.

@aaronfranke
Copy link
Member

aaronfranke commented Nov 30, 2020

Yeah. Also, I noticed this comment: https://github.com/godotengine/godot/blob/master/tests/test_string.h#L1166

@RandomShaper
Copy link
Member Author

I'd take some inspiration from the JS URI encode API: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI

Maybe we even would better have separate full and component-wise encoding methods. If I remember correctly, when I worked on that, I considered the possibility, but I can't remember the reason now.

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

Successfully merging this pull request may close these issues.

3 participants