Hi, I'm trying to send data by using the HTTPRequest function and it works great when the data is pure english. When I put any kind of other languages, the web application is received the garbled.

After testing a while, I doubt that the query_string_from_dict function and HttpRequest function seems not to support non-English language? Please forgive me if I was mistaken.

when in English: "jsonData":["{\"id\":\"123\",\"en\":\"Hi.\",\"zh\":\"Hi.\"}"]

when I put different language in data: "jsonData":"%7B%22id%22%3A%22123%22%2C%22en%22%3A%22Hi.%22%2C%22zh%22%3A%22%%%%%%%21%22%7D"

The code: `func _on_WriteButton_pressed(): var headers = ["Content-Type : application/x-www-form-urlencoded"] var http = HTTPClient.new() var headers_pool = PoolStringArray(headers)


var query: Dictionary = {}
query["method"] = "write"
query["jsonData"] = "{\"id\":\"123\",\"en\":\"Hi.\",\"zh\":\"你好!\"}"

$HTTPRequest.request(UrlPath, headers_pool, true, HTTPClient.METHOD_POST, http.query_string_from_dict(query))`

@bingrunj said: Hi, I'm trying to send data by using the HTTPRequest function and it works great when the data is pure english. When I put any kind of other languages, the web application is received the garbled.

I just tried this, and the data transports fine for me, at least when everything is UTF-8 encoded. I think you'll need to check your raw server request logs versus your server application logs to figure out what component is mangling your payloads, but I don't believe it to be Godot.

@bingrunj said: var headers = ["Content-Type : application/x-www-form-urlencoded"]

Oh, and I meant to ask about this -- why send your request body as application/x-www-form-urlencoded with one of the fields containing URL-encoded JSON vs just sending the body as application/json and just sending JSON?

Hi, @llasram , Thanks for the reply, I'm trying to send data to the google spreadsheet through the google apps script. I did this in unity by using a plugin and I'm going to mimic the way it provide. In this way, I successfully sending and receiving data in pure English but stock in using other languages.

I might seek the decode way that doing at apps script and thanks for taking your time to test it for me. I appreciate it.

I will update this thread if I found a way to do this.

@bingrunj said: I'm trying to send data to the google spreadsheet through the google apps script. I did this in unity by using a plugin and I'm going to mimic the way it provide.

Oh, interesting. Not controlling the backend certainly complicates things! But if you've got working code in Unity that's generating the HTTP requests you want to generate in Godot, then could try sniffing them both with Wireshark and comparing to see what Godot is emitting differently.

6 days later

Hello again, @llasram I finally make it works by sending the body as application/json and JSON data. Just need some code at gs. Thank you for your advice!

2 years later