Skip to content
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

Pile-of-poo test for text-to-unicode #1081

Open
lionel-rowe opened this issue May 14, 2024 · 0 comments · May be fixed by #1087
Open

Pile-of-poo test for text-to-unicode #1081

lionel-rowe opened this issue May 14, 2024 · 0 comments · May be fixed by #1087
Assignees
Labels
bug Something isn't working triage

Comments

@lionel-rowe
Copy link

Describe the bug

The text-to-unicode tool fails the Pile of Poo Test:

Whenever you’re working on a piece of JavaScript code that deals with strings or regular expressions in some way, just add a unit test that contains a pile of poo (💩) in a string, and see if anything breaks.

In other words, it fails to correctly handle any non-BMP code point (code points higher than 0xffff).

Also, decimal-encoded HTML/XML entities seems like an odd default choice to represent "Unicode". I'd expect the default to be \u{...} or maybe U+... notation, with ... being hex digits. But offering HTML/XML entities as an alternative could be useful too.

What happened?

💩 results for https://it-tools.tech/text-to-unicode:

image

document.write('��') renders as ��, not 💩.

System information

Win 11, Chrome Version 124.0.6367.158 (Official Build) (64-bit)

Where did you encounter the bug?

Public app (it-tools.tech)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants