uʍop-ǝpᴉsdn 文本如何工作?
Here's a website I found that will produce upside down versions of any English text.
how does it work? does unicode have upside down chars? Or what?
How can I write my own text flipping function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Unicode 确实有颠倒的字符。他们的名字中有“TURNED”:
然而,它还远不是一个完整的集合。大多数颠倒文本的工作原理是选择与颠倒字母非常相似的字符。这相当于在计算器上输入 0.7734 来拼写“hELLO”。
Unicode does have upside-down characters. They have "TURNED" in their name:
However, it's far from a complete set. Most upside-down text works by choosing characters that happen to have a close-enough resemblance to upside-down letters. It's the equivalent of typing 0.7734 on your calculator to spell "hELLO".
是的!或者至少是看起来像是颠倒的角色。此外,常规的英文字母字符可能看起来是颠倒的。就像u可以是颠倒的n。
要对其进行编码,您只需获取一个字符数组,以相反的顺序显示它们,并将这些字符替换为它们的颠倒版本。这会给你一个好的开始:zʎxʍʌnʇsɹbdouɯןʞſıɥbɟǝpɔqɐ
Yup! Or at least characters that look like they are upside down. Also, regular English-alphabetical characters can appear to be upside down. Like u could be an upside-down n.
To code it up, you just have to take an array of characters, display them in reverse order and replace those characters with the upside down version of them. This will get you a good start: zʎxʍʌnʇsɹbdouɯןʞſıɥbɟǝpɔqɐ
当“uʍop-ǝpısdn”被复制并回显到十六进制转储程序时,该字符串将被视为:
其 UTF-8 细分为:
When 'uʍop-ǝpısdn' is copied and echoed into a hex dump program, the string is seen as:
The UTF-8 breakdown of that is:
它们只是 unicode 字符。
They are just unicode characters.
查看网页来源:
Look at source of web page:
有一个“颠倒的”Python 模块。 https://pypi.org/project/upsidedown/。它也支持非英文字符。源代码:https://github.com/cburgmer/upsidedown。问题已经回答了多次,但坚持规则:没有魔法,字符串的字符被字符替换 - 或多或少类似于倒置的字符。您可以使用 sed:
构建字典,
或更好的方法 - 为 sed: script.sed:
然后:
然后“仅”反转顺序。
附言。还有另一个带有颠倒文本生成器的网站:
https://www.web2generators.com/text-lated-tools/倒写
There is the ”upsidedown” python module. https://pypi.org/project/upsidedown/. And it supports non-english characters too. For the source code: https://github.com/cburgmer/upsidedown. Question was already answered multiple times, but holding to the rules: There is no magic, the characters of the string are replaced by characters - more or less similar to inverted ones. You can do it with sed:
or better - to build the dictionary for sed:
script.sed:
and then:
and then "only" reverse the the order.
PS. There is another website with upside-down-text generator:
https://www.web2generators.com/text-related-tools/write-upside-down
有些 Unicode 字符看起来与普通字母相似,并且是倒转的,例如:B 的倒转版本可以是“ᗺ”,它是加拿大音节载体 Kha 字符 (U+15FA),此网站 https://www.upsidedowntext.top/ 包含用于生成颠倒文本的所有反转 Unicode 字符的列表。
如需更多说明,您可以查看此字体生成器网站 https://fontgenerator.cc/,它创建了许多其他花哨的字体使用不同 Unicode 字符的样式。
您可以通过使用普通字母表作为键、使用 Unicode 字符作为值来初始化映射来实现此目的。之后,您所要做的就是获取用户输入并将每个输入字符转换为映射中对应的 Unicode 字符值。
There are Unicode characters that look similar to normal letters and are inverted, For instance: B's inverted version can be "ᗺ" which is a Canadian Syllabics Carrier Kha Character (U+15FA), this website https://www.upsidedowntext.top/ has a list of all inverted Unicode characters it uses to generate Upside down text.
For more clarification, you can see this Font Generator website https://fontgenerator.cc/, which creates many other fancy styles using different Unicode characters.
You can do this by initializing a map with normal alphabets as keys and Unicode characters as their values. After that, all you have to do is take user input and convert each input character to its corresponding Unicode character value from map.