Zalgo文字如何工作?

HTML

泡芙Green

2020-03-17

我在各种论坛上都看到过奇怪的格式化文本Zalgo,如下所示。看起来很烦人,但它确实使我感到困扰,因为它破坏了我对角色应该是什么样的观念。我的理解是,角色应该在一条线上水平移动并停留在某个“容器”内。显然,Zalgo文本是垂直移动的,似乎不受任何空间限制。

这是Unicode中的错误/缺陷/漏洞利用/黑客吗?这些单个字符是否具有怪异的属性?“什么”在这里发生?


̡̫̤̤̣͉̤͎͉͖ͭ̓̓̇͗̎̀͋ͬ̌ͯͅͅ ̳̘̿̃̔̏ͣ͂̉̕ ̸͎͉͖̖̙̤͓̞̱̫̌ͯ̆͋ͤ͗̓͟͜ͅͅ ̸̤͓̞̱̫ ̸̤͓̞̱̫ ̸̤͓̞̱̫ ̸̤͓̞̱̫ ̛͓̖̻̲ͤ̈ͣ͝ ̛͓̖̻̲ͤ̈ͣ͝ ̛͓̖̻̲ͤ̈ͣ͝ ̛͓̖̻̲ͤ̈ͣ͝ ̛͓̖̻̲ͤ̈ͣ͝ ͋̄ͬ̽͜҉͚̭͇ͅ ̛͓̖̻̲ͤ̈ͣ͝ ̵̶̵̶̵̶̛͓̖̻̲̗̮̮̗̮̮̗̮̮ͤ̈ͣ͝


第1949篇《Zalgo文字如何工作?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

2个回答
乐Itachi 2020.03.17

The text uses combining characters, also known as combining marks. See section 2.11 of Combining Characters in the Unicode Standard (PDF).

In Unicode, character rendering does not use a simple character cell model where each glyph fits into a box with given height. Combining marks may be rendered above, below, or inside a base character

So you can easily construct a character sequence, consisting of a base character and “combining above” marks, of any length, to reach any desired visual height, assuming that the rendering software conforms to the Unicode rendering model. Such a sequence has no meaning of course, and even a monkey could produce it (e.g., given a keyboard with suitable driver).

And you can mix “combining above” and “combining below” marks.

The sample text in the question starts with:

Itachi伽罗 2020.03.17

Zalgo文本之所以有效,是因为结合了字符。这些是特殊字符,允许修改之前出现的字符。

在此处输入图片说明

要么

y +̆=y̆实际上是

y + ̆ = y̆

由于您可以将它们一个接一个地堆叠,因此可以产生以下内容:


̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆

实际上是:

y̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆

将东西放在下面也是如此:


̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆



实际上是:

y̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆̆

在Unicode中,将欧洲语言的变音符号和国际音标结合起来的主要步骤是U + 0300–U + 036F。

在这里了解更多

要产生一个组合变音标记的列表,您可以使用以下脚本(因为链接不断消失)

for(var i=768; i<879; i++){console.log(new DOMParser().parseFromString("&#"+i+";", "text/html").documentElement.textContent +"  "+"&#"+i+";");}

还检查他们



Mͣͭͣ̾Vͣͥͭ͛ͤͮͥͨͥͧ̾

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android