it-tools icon indicating copy to clipboard operation
it-tools copied to clipboard

Add Standard Unicode Encoding Support (\uXXXX) for Text Conversion

Open superglg738 opened this issue 6 months ago • 2 comments

Describe the bug

Currently, the text-to-Unicode conversion feature outputs HTML entity codes (&#xxxxx;), which are not standard Unicode escape sequences. I'd like to request support for standard Unicode encoding (\uXXXX format).

Image

What happened?

Proposed Solution:​

// Text → Standard Unicode escape sequence (\uXXXX) function textToUnicodeEscape(text: string): string { return text.split('').map(c => '\u' + c.charCodeAt(0).toString(16).padStart(4, '0') ).join(''); }

// Unicode escape sequence → Text function unicodeEscapeToText(unicodeStr: string): string { return unicodeStr.replace(/\u([\dA-F]{4})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)) ); }

System information

E:\Work\it-tools-main>npx envinfo --system --browsers Need to install the following packages: [email protected] Ok to proceed? (y) y

System: OS: Windows 11 10.0.26100 CPU: (32) x64 Intel(R) Core(TM) i9-14900 Memory: 26.97 GB / 63.69 GB Browsers: Edge: Chromium (136.0.3240.92) Internet Explorer: 11.0.26100.1882

Where did you encounter the bug?

Public app (it-tools.tech)

superglg738 avatar Jun 18 '25 01:06 superglg738

Hi @superglg738 , should be ok here: https://sharevb-it-tools.vercel.app/text-to-unicode

And if you are interested in an up to date version of it-tools, with many improvements, new tools, and bug fixes, as this repo is almost no more maintained, I made a fork here : https://github.com/sharevb/it-tools (https://sharevb-it-tools.vercel.app/ and docker images https://github.com/sharevb/it-tools/pkgs/container/it-tools)

sharevb avatar Jun 18 '25 10:06 sharevb

thanks for your answer。

sharevb vs corentinth

sharevb is 2025.06.15

superglg738 avatar Jun 18 '25 13:06 superglg738