Hongmu Notes

🧶 Native to Unicode entity conversion

Convert text to decimal character entities in both directions.

Native to Unicode entity conversion

Instructions for use

  • The text is filled in at the top and the entity is filled in at the bottom. Press the button to switch in both directions.
  • The entity is in the form of &# plus decimal code point plus semicolon. The semicolon cannot be omitted.
  • Keep non-solid parts intact during restoration

Native to Unicode

The most practical benefit of writing characters in physical form is that any channel that only recognizes ASCII can safely transmit Chinese without being destroyed by transcoding.

📌 Why is the result so long?

Because each character must be written in the fixed form of &# plus five to seven digits plus a semicolon, one Chinese character occupies more than eight digits, so the length of the entire paragraph will expand several times after conversion; this is the inherent cost of the physical writing method, and it is not repeated output by the tool.

📌 Conversion rules

Both directions are processed character by character: when converting to entities, the Unicode code point of each character is taken and spelled into the form of &# plus decimal digits plus semicolon, so a Chinese character will occupy more than seven digits; when restoring, use regular expressions to match all entity fragments, extract the decimal digits and convert them back to characters, and keep the parts that are not in the entity as they are, so the entire mixed content can be restored safely.

🧭 Common uses

It is used to check the writing of entities in the web page source code and the email body, confirm the decimal code point of a certain character, convert characters that are easily changed by the editor into entity form before transmitting them, and express Chinese in a channel that only allows ASCII. It is used in conjunction with hexadecimal escape tools to cover the two most common character encoding writing forms.

All keywords and tutorials 12

❓ FAQ

Can I only translate to Chinese?
No. This page is converted character by character, and English and punctuation will also become entities.
Can the results be put directly into HTML?
Yes. Entity writing can be parsed normally in HTML and XML.
The purpose of converting Native to Unicode
Only allow Chinese to be transmitted through the ASCII channel, check character code points, and prepare sample text in entity form.