I have a cloud function that I am using as a webhook.
Whenever it is receiving something in Hindi it changes it to question Marks '?'.
I've tested it in my local system, where it works fine.
I have a cloud function that I am using as a webhook.
Whenever it is receiving something in Hindi it changes it to question Marks '?'.
I've tested it in my local system, where it works fine.
For further actions, you may consider blocking this person and/or reporting abuse
Hey, could you share your cloud function code? I'll have a look if there's anything that stands out.
Also, are you using the same tool to send the webhook request when you test locally vs the deployed cloud function?
Feel free to message me directly too. We can troubleshoot and post the issue and solution here for others to learn from.
Hey Mike,
Thanks for the prompt response.
I am using postman for local testing
Below is the my cloud function
Request Data
Thanks for that. The implementation of a few functions is missing, for example
getAllFields
. Before we dive into that, where do you see the question marks? In your database?If you print one of the
fieldLabel
values that contains Hindi characters at the beginning of the cloud function, do you see?
too? What about after you callgetAllFields
?Let's try to narrow down where the
?
first appear, that will help us determine what causes it.I found this question on stackoverflow
stackoverflow.com/questions/605618...
I logged
_request.body
at the start of the function.Having the same problem.
Given that you have the same problem with the data you receive in the request body, this is likely an issue with how the sender encodes the data.
I wrote a very basic Cloud Function with the following code. (Note: you seem to use Firebase Functions, I didn't test that but don't expect that to be the cause of the problem you see):
I called it with the following command from the terminal:
The log output is: dev-to-uploads.s3.amazonaws.com/i/...
Ok thanks..
I'll do some testing and will let you know
Try a most basic command with
curl
like in my example. Keep me posted, I'll see what I can do to help you troubleshoot this.The problem was with the data I was receiving from webhook :D
Nice find, thanks for sharing. It makes sense given you already saw question marks when you logged the request body. Glad you've resolved that.