HZ (character encoding)
The HZ character encoding is an encoding of GB 2312 that was formerly commonly used in email and USENET postings.[src] It was designed in 1989 by Fung Fung Lee ( ) of Stanford University, and subsequently codified in 1995 into RFC 1843.[src] The HZ, short for Hanzi ( ), encoding was invented to facilitate the use of Chinese characters through e-mail, which at that time only allowed 7-bit characters.[src] Therefore, in lieu of standard ISO 2022 escape sequences (as in the case of ISO-2022-JP) or 8-bit characters (as in the case of EUC), the HZ code uses only printable, 7-bit characters to represent Chinese characters.[src] It was also popular in USENET networks, which in the late 1980s and early 1990s, generally did not allow transmission of 8-bit characters or escape characters.[src]
The HZ character encoding is an encoding of GB 2312 that was formerly commonly used in email and USENET postings.[src] It was designed in 1989 by Fung Fung Lee ( ) of Stanford University, and subsequently codified in 1995 into RFC 1843.[src] The HZ, short for Hanzi ( ), encoding was invented to facilitate the use of Chinese characters through e-mail, which at that time only allowed 7-bit characters.[src] Therefore, in lieu of standard ISO 2022 escape sequences (as in the case of ISO-2022-JP) or 8-bit characters (as in the case of EUC), the HZ code uses only printable, 7-bit characters to represent Chinese characters.[src] It was also popular in USENET networks, which in the late 1980s and early 1990s, generally did not allow transmission of 8-bit characters or escape characters.[src] ==History== HZ superseded the earlier "zW" encoding, which marked entire lines as being GB 2312 text by beginning them with the characters zW .[src] ==Structure and use== In the HZ encoding system, the character sequences "~{" and "~}" act as escape sequences; anything between them is interpreted as Chinese encoded in GB 2312 (the most significant bits are ignored).[src] Outside the escape sequences, characters are assumed to be ASCII.[src] An example will help illustrate the relationship between GB 2312, EUC-CN, and the HZ code: HZ was originally designed to be used purely as a 7-bit code.[src] However, when situations allow, the escape sequences "~{" and "~}" sometimes surround characters represented in EUC-CN; this alternative use allows Chinese to be readable either with the help of HZ decoder software, or with a system that understands EUC-CN.[src] Additionally, the specification defines that: the sequence "~~" is to be treated as encoding a single ASCII "~" and, the character "~" followed by a newline is to be discarded.[src] However, not all HZ decoders follow these two rules.[src] ==HZ encoders and decoders== The first HZ encoder and decoder were written in 1989 by the code's inventor for the Unix operating system.[src] The program, also for the Unix operating system, was also among the first and one of the most popular HZ decoders.[src] It deviates from the specification in that it will display the escape sequences (i.e., "~{" and "~}"), and it does not treat "~~" and "~" followed by a newline specially.[src] This was probably to allow software which assumes one character to occupy one screen position (on a text screen) to function correctly without modification.[src] Support on Microsoft Windows came later, and a number of third-party "Chinese systems" support HZ.[src] These systems may provide an option to hide the escape sequences.[src] ==Disadvantages== Because of its escape sequences, and furthermore because its escape delimiters are printable characters in ASCII, it is fairly easy to construct attack byte sequences that round-trip from HZ to Unicode and back.[src] Use of HZ encoding is thus treated as suspicious by malware protection suites.[src] ==References==[src]
26 sentences · 26 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"HZ (character encoding)." encyclopegia.org, 2024, https://encyclopegia.org/wiki/hz-character-encoding. Accessed 04 December 2026.
Chicago
"HZ (character encoding)." encyclopegia.org. Accessed December 4, 2026. https://encyclopegia.org/wiki/hz-character-encoding.
APA
encyclopegia.org. (2024). HZ (character encoding). Retrieved December 4, 2026, from https://encyclopegia.org/wiki/hz-character-encoding
Accessed December 4, 2026 · CC BY-SA 4.0 · citation page · JSON