Skip to content

Gen2: Encoding issue with special characters in path parameters #1459

Description

@Llolow

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:
    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.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions