-
Notifications
You must be signed in to change notification settings - Fork 203
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
Gen2: Encoding issue with special characters in path parameters #1459
Comments
I found a few problems with this issue:
|
Hi @Llolow. I don't have a solution yet, but I wanted to share an update. It looks like the issue you've found goes beyond Cloud Functions for Firebase, and I'm in conversations with other teams at GCP to find the underlying issue. Thanks for your patience. |
Hello @taeold, thanks for the answer. I will use for the moment the fact than gen1 and gen2 functions can coexist |
@Llolow Sorry for not responding sooner. I've learned since then that const planetId = Buffer.from(event.params.planeteId, "binary").toString("utf-8") I would agree with you to think that this is pretty tricky. Let me try and see if we can come up with a way to do the conversion in the SDK itself so you don't have to bother with these kind of problems. |
Hi @taeold , Also: I definitely don't consider this to be a feature request, but a serious bug that affects real-life usage of Cloud Functions v2. |
Hi again @taeold , Taking the string "SDÅV" as an example:
Application of the suggested workaround in case the parameter is already in utf-8:
|
Hey, this is an issue for us as well. If the document id in |
Same issue here. Definitely a bug if v1 and v2 behave differently. |
Version info
node: v18.16.0
firebase-functions: v4.4.1
firebase-tools: v12.5.2
firebase-admin: v11.8.0
Steps to reproduce
This issue was not encountered in gen1, and special characters in path parameters were correctly encoded.
planeteId
document contains special characters such as "é", "è", "à", etc. Example: "Helvétios", "Électre".planeteId
value in the deployed functionExpected behavior
The
planeteId
value should be correctly encoded and displayed in UTF-8, preserving special characters such as "é", "è", "à", etc., in the deployed Firebase Cloud Function Gen2.Actual behavior
After deploying the Firebase Cloud Function Gen2, the
planeteId
value appears to be incorrectly encoded, resulting in a value likeHelvétios
becomingHelvétios
orÉlectre
becoming�lectre
.Were you able to successfully deploy your functions?
Yes, the deployment was successful without any error messages.
The text was updated successfully, but these errors were encountered: