firebase / firebase/firebase-functions

Gen2: Encoding issue with special characters in path parameters

Open
#1,459 12 comments 0 reactions 1 assignee Claimed by @taeold View on GitHub
feature request
Dominant language
TypeScript
Stars
1.1k
Forks
232
Avg merge
20h 46m
Merged PRs (30d)
15

Description

### 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.**

- Deploy a Firebase Cloud Function Gen2 using a Firestore trigger as follows:
```javascript
import { log } from "firebase-functions/logger";
import { onDocumentUpdated } from "firebase-functions/v2/firestore";

export const testPlanet = onDocumentUpdated("planetes/{planeteId}", async (event) => {
log(event.params.planeteId);
});
```
- Ensure that the `planeteId` document contains special characters such as "é", "è", "à", etc. Example: "Helvétios", "Électre".
- Observe the `planeteId` value in the deployed function

### Expected 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 like `Helvétios` becoming `Helvétios` or `Électre` becoming `Électre`.

### Were you able to successfully deploy your functions?

Yes, the deployment was successful without any error messages.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.