You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Describe the bug
The
text-to-unicode
tool fails the Pile of Poo Test: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 maybeU+...
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:
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)
The text was updated successfully, but these errors were encountered: