Skip to content

Different utf8 escape sequences for Ţ and Ţ #66862

Closed

Description

@richytong

Version

v26.12.0

Platform

Linux ___ 6.18.56-1-lts #1 SMP PREEMPT_DYNAMIC Mon, 12 Oct 2026 05:13:23 +0000 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

From the Node.js repl, run the following example.

encodeURIComponent("Ţ") // T%CC%A7
encodeURIComponent("Ţ") // %C5%A2

How often does it reproduce? Is there a required condition?

100% of the time.

What is the expected behavior? Why is that the expected behavior?

encodeURIComponent("Ţ") // T%CC%A7
encodeURIComponent("Ţ") // T%CC%A7

or

encodeURIComponent("Ţ") // %C5%A2
encodeURIComponent("Ţ") // %C5%A2

What do you see instead?

encodeURIComponent("Ţ") // T%CC%A7
encodeURIComponent("Ţ") // %C5%A2

Additional information

No response

Activity

  1. bakkot commented on Oct 19, 2026

    @bakkot
    Contributor

    This is correct behavior. encodeURIComponent works off the raw UTF-8 encoding of the string. If you want to normalize, that's what String.prototype.normalize is for: encodeURIComponent("Ţ".normalize()) === encodeURIComponent("Ţ".normalize()) // true.

  2. added
    questionIssues asking questions about Node.js.
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions