0 votes

The scenario

I'm making a PUT request using the HTTPRequest node. In the URL I want to include an emoji. For this I have to URL Encode it. But the String.percent_encode() method is not giving correct results.

The problem

String.percent_encode() gives: %ed%a0%bd%ed%b4%94
Desired result is: %F0%9F%94%94

This is only the case for some unicode emojis. For example, for the emoji ❤️, the String.percent_encode gives the desired result of %e2%9d%a4%ef%b8%8f
I've tried String.http_escape but it is not the desired result.
Is there any way I can get an emoji to map to the correct URL Encoded version.

Godot version 3.3.2
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.