uʍop-ǝpᴉsdn 文本如何工作?

发布于 2024-09-04 21:02:23 字数 172 浏览 2 评论 0原文

这是我发现的一个网站,可以生成任何英文文本的颠倒版本。

它是如何实现的工作? unicode有颠倒的字符吗?或者什么?

如何编写自己的文本翻转功能?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

Smile简单爱 2024-09-11 21:02:24

它是如何工作的? unicode 有吗
颠倒的字符?

Unicode 确实有颠倒的字符。他们的名字中有“TURNED”:

ƍ U+018D LATIN SMALL LETTER TURNED DELTA
Ɯ U+019C LATIN CAPITAL LETTER TURNED M
ǝ U+01DD LATIN SMALL LETTER TURNED E
Ʌ U+0245 LATIN CAPITAL LETTER TURNED V
ɐ U+0250 LATIN SMALL LETTER TURNED A
ɒ U+0252 LATIN SMALL LETTER TURNED ALPHA
ɥ U+0265 LATIN SMALL LETTER TURNED H
ɯ U+026F LATIN SMALL LETTER TURNED M
ɰ U+0270 LATIN SMALL LETTER TURNED M WITH LONG LEG
ɹ U+0279 LATIN SMALL LETTER TURNED R
ɺ U+027A LATIN SMALL LETTER TURNED R WITH LONG LEG
ɻ U+027B LATIN SMALL LETTER TURNED R WITH HOOK
ʇ U+0287 LATIN SMALL LETTER TURNED T
ʌ U+028C LATIN SMALL LETTER TURNED V
ʍ U+028D LATIN SMALL LETTER TURNED W
ʎ U+028E LATIN SMALL LETTER TURNED Y
ʞ U+029E LATIN SMALL LETTER TURNED K
ʮ U+02AE LATIN SMALL LETTER TURNED H WITH FISHHOOK
ʯ U+02AF LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
ʴ U+02B4 MODIFIER LETTER SMALL TURNED R
ʵ U+02B5 MODIFIER LETTER SMALL TURNED R WITH HOOK
ʻ U+02BB MODIFIER LETTER TURNED COMMA
̒ U+0312 COMBINING TURNED COMMA ABOVE
ჹ U+10F9 GEORGIAN LETTER TURNED GAN
ᴂ U+1D02 LATIN SMALL LETTER TURNED AE
ᴈ U+1D08 LATIN SMALL LETTER TURNED OPEN E
ᴉ U+1D09 LATIN SMALL LETTER TURNED I
ᴔ U+1D14 LATIN SMALL LETTER TURNED OE
ᴚ U+1D1A LATIN LETTER SMALL CAPITAL TURNED R
ᴟ U+1D1F LATIN SMALL LETTER SIDEWAYS TURNED M
ᵄ U+1D44 MODIFIER LETTER SMALL TURNED A
ᵆ U+1D46 MODIFIER LETTER SMALL TURNED AE
ᵌ U+1D4C MODIFIER LETTER SMALL TURNED OPEN E
ᵎ U+1D4E MODIFIER LETTER SMALL TURNED I
ᵚ U+1D5A MODIFIER LETTER SMALL TURNED M
ᵷ U+1D77 LATIN SMALL LETTER TURNED G
ᶛ U+1D9B MODIFIER LETTER SMALL TURNED ALPHA
ᶣ U+1DA3 MODIFIER LETTER SMALL TURNED H
ᶭ U+1DAD MODIFIER LETTER SMALL TURNED M WITH LONG LEG
ᶺ U+1DBA MODIFIER LETTER SMALL TURNED V
℩ U+2129 TURNED GREEK SMALL LETTER IOTA
Ⅎ U+2132 TURNED CAPITAL F
⅁ U+2141 TURNED SANS-SERIF CAPITAL G
⅂ U+2142 TURNED SANS-SERIF CAPITAL L
⅄ U+2144 TURNED SANS-SERIF CAPITAL Y
⅋ U+214B TURNED AMPERSAND
ⅎ U+214E TURNED SMALL F
⌙ U+2319 TURNED NOT SIGN
❛ U+275B HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT
❝ U+275D HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT
⦢ U+29A2 TURNED ANGLE
Ɐ U+2C6F LATIN CAPITAL LETTER TURNED A
ⱹ U+2C79 LATIN SMALL LETTER TURNED R WITH TAIL
ⱻ U+2C7B LATIN LETTER SMALL CAPITAL TURNED E
Ꝿ U+A77E LATIN CAPITAL LETTER TURNED INSULAR G
ꝿ U+A77F LATIN SMALL LETTER TURNED INSULAR G
Ꞁ U+A780 LATIN CAPITAL LETTER TURNED L
ꞁ U+A781 LATIN SMALL LETTER TURNED L

然而,它还远不是一个完整的集合。大多数颠倒文本的工作原理是选择与颠倒字母非常相似的字符。这相当于在计算器上输入 0.7734 来拼写“hELLO”。

how does it work? does unicode have
upside down chars?

Unicode does have upside-down characters. They have "TURNED" in their name:

ƍ U+018D LATIN SMALL LETTER TURNED DELTA
Ɯ U+019C LATIN CAPITAL LETTER TURNED M
ǝ U+01DD LATIN SMALL LETTER TURNED E
Ʌ U+0245 LATIN CAPITAL LETTER TURNED V
ɐ U+0250 LATIN SMALL LETTER TURNED A
ɒ U+0252 LATIN SMALL LETTER TURNED ALPHA
ɥ U+0265 LATIN SMALL LETTER TURNED H
ɯ U+026F LATIN SMALL LETTER TURNED M
ɰ U+0270 LATIN SMALL LETTER TURNED M WITH LONG LEG
ɹ U+0279 LATIN SMALL LETTER TURNED R
ɺ U+027A LATIN SMALL LETTER TURNED R WITH LONG LEG
ɻ U+027B LATIN SMALL LETTER TURNED R WITH HOOK
ʇ U+0287 LATIN SMALL LETTER TURNED T
ʌ U+028C LATIN SMALL LETTER TURNED V
ʍ U+028D LATIN SMALL LETTER TURNED W
ʎ U+028E LATIN SMALL LETTER TURNED Y
ʞ U+029E LATIN SMALL LETTER TURNED K
ʮ U+02AE LATIN SMALL LETTER TURNED H WITH FISHHOOK
ʯ U+02AF LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
ʴ U+02B4 MODIFIER LETTER SMALL TURNED R
ʵ U+02B5 MODIFIER LETTER SMALL TURNED R WITH HOOK
ʻ U+02BB MODIFIER LETTER TURNED COMMA
̒ U+0312 COMBINING TURNED COMMA ABOVE
ჹ U+10F9 GEORGIAN LETTER TURNED GAN
ᴂ U+1D02 LATIN SMALL LETTER TURNED AE
ᴈ U+1D08 LATIN SMALL LETTER TURNED OPEN E
ᴉ U+1D09 LATIN SMALL LETTER TURNED I
ᴔ U+1D14 LATIN SMALL LETTER TURNED OE
ᴚ U+1D1A LATIN LETTER SMALL CAPITAL TURNED R
ᴟ U+1D1F LATIN SMALL LETTER SIDEWAYS TURNED M
ᵄ U+1D44 MODIFIER LETTER SMALL TURNED A
ᵆ U+1D46 MODIFIER LETTER SMALL TURNED AE
ᵌ U+1D4C MODIFIER LETTER SMALL TURNED OPEN E
ᵎ U+1D4E MODIFIER LETTER SMALL TURNED I
ᵚ U+1D5A MODIFIER LETTER SMALL TURNED M
ᵷ U+1D77 LATIN SMALL LETTER TURNED G
ᶛ U+1D9B MODIFIER LETTER SMALL TURNED ALPHA
ᶣ U+1DA3 MODIFIER LETTER SMALL TURNED H
ᶭ U+1DAD MODIFIER LETTER SMALL TURNED M WITH LONG LEG
ᶺ U+1DBA MODIFIER LETTER SMALL TURNED V
℩ U+2129 TURNED GREEK SMALL LETTER IOTA
Ⅎ U+2132 TURNED CAPITAL F
⅁ U+2141 TURNED SANS-SERIF CAPITAL G
⅂ U+2142 TURNED SANS-SERIF CAPITAL L
⅄ U+2144 TURNED SANS-SERIF CAPITAL Y
⅋ U+214B TURNED AMPERSAND
ⅎ U+214E TURNED SMALL F
⌙ U+2319 TURNED NOT SIGN
❛ U+275B HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT
❝ U+275D HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT
⦢ U+29A2 TURNED ANGLE
Ɐ U+2C6F LATIN CAPITAL LETTER TURNED A
ⱹ U+2C79 LATIN SMALL LETTER TURNED R WITH TAIL
ⱻ U+2C7B LATIN LETTER SMALL CAPITAL TURNED E
Ꝿ U+A77E LATIN CAPITAL LETTER TURNED INSULAR G
ꝿ U+A77F LATIN SMALL LETTER TURNED INSULAR G
Ꞁ U+A780 LATIN CAPITAL LETTER TURNED L
ꞁ U+A781 LATIN SMALL LETTER TURNED L

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".

墨小墨 2024-09-11 21:02:24

unicode有颠倒的字符吗?

是的!或者至少是看起来像是颠倒的角色。此外,常规的英文字母字符可能看起来是颠倒的。就像u可以是颠倒的n

要对其进行编码,您只需获取一个字符数组,以相反的顺序显示它们,并将这些字符替换为它们的颠倒版本。这会给你一个好的开始:zʎxʍʌnʇsɹbdouɯןʞſıɥbɟǝpɔqɐ

does unicode have upside down chars?

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ɐ

与风相奔跑 2024-09-11 21:02:24

当“uʍop-ǝpısdn”被复制并回显到十六进制转储程序时,该字符串将被视为:

75 CA 8D 6F 70 2D C7 9D 70 C4 B1 73 64 6E

其 UTF-8 细分为:

0x75      = U+0075 = LATIN SMALL LETTER U
0xCA 0x8D = U+028D = LATIN SMALL LETTER TURNED W
0x6F      = U+006F = LATIN SMALL LETTER O
0x70      = U+0070 = LATIN SMALL LETTER P
0x2D      = U+002D = HYPHEN MINUS
0xC7 0x9D = U+01DD = LATIN SMALL LETTER TURNED E
0x70      = U+0070 = LATIN SMALL LETTER P
0xC4 0xB1 = U+0131 = LATIN SMALL LETTER DOTLESS I
0x73      = U+0073 = LATIN SMALL LETTER S
0x64      = U+0064 = LATIN SMALL LETTER D
0x6E      = U+006E = LATIN SMALL LETTER N

When 'uʍop-ǝpısdn' is copied and echoed into a hex dump program, the string is seen as:

75 CA 8D 6F 70 2D C7 9D 70 C4 B1 73 64 6E

The UTF-8 breakdown of that is:

0x75      = U+0075 = LATIN SMALL LETTER U
0xCA 0x8D = U+028D = LATIN SMALL LETTER TURNED W
0x6F      = U+006F = LATIN SMALL LETTER O
0x70      = U+0070 = LATIN SMALL LETTER P
0x2D      = U+002D = HYPHEN MINUS
0xC7 0x9D = U+01DD = LATIN SMALL LETTER TURNED E
0x70      = U+0070 = LATIN SMALL LETTER P
0xC4 0xB1 = U+0131 = LATIN SMALL LETTER DOTLESS I
0x73      = U+0073 = LATIN SMALL LETTER S
0x64      = U+0064 = LATIN SMALL LETTER D
0x6E      = U+006E = LATIN SMALL LETTER N
錯遇了你 2024-09-11 21:02:24

它们只是 unicode 字符。

在此处输入图像描述

They are just unicode characters.

enter image description here

孤独患者 2024-09-11 21:02:24

查看网页来源:

function flip() {
    var result = flipString(document.f.original.value);
    document.f.flipped.value = result;
}

function flipString(aString) {
    aString = aString.toLowerCase();
    var last = aString.length - 1;
    var result = "";
    for (var i = last; i >= 0; --i) {
        result += flipChar(aString.charAt(i))
    }
    return result;
}

function flipChar(c) {
    if (c == 'a') {
        return '\u0250'
    }
    else if (c == 'b') {
        return 'q'
    }
    else if (c == 'c') {
        return '\u0254' //Open o -- copied from pne

Look at source of web page:

function flip() {
    var result = flipString(document.f.original.value);
    document.f.flipped.value = result;
}

function flipString(aString) {
    aString = aString.toLowerCase();
    var last = aString.length - 1;
    var result = "";
    for (var i = last; i >= 0; --i) {
        result += flipChar(aString.charAt(i))
    }
    return result;
}

function flipChar(c) {
    if (c == 'a') {
        return '\u0250'
    }
    else if (c == 'b') {
        return 'q'
    }
    else if (c == 'c') {
        return '\u0254' //Open o -- copied from pne
束缚m 2024-09-11 21:02:24

有一个“颠倒的”Python 模块。 https://pypi.org/project/upsidedown/。它也支持非英文字符。源代码:https://github.com/cburgmer/upsidedown。问题已经回答了多次,但坚持规则:没有魔法,字符串的字符被字符替换 - 或多或少类似于倒置的字符。您可以使用 sed:

echo "abc" | sed 's/a/ɐ/g; s/b/q/g; s/c/ɔ/g'

构建字典,

或更好的方法 - 为 sed: script.sed:

s/a/ɐ/g
s/b/q/g
s/c/ɔ/g

然后:

echo "abc" | sed -f 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:

echo "abc" | sed 's/a/ɐ/g; s/b/q/g; s/c/ɔ/g'

or better - to build the dictionary for sed:

script.sed:

s/a/ɐ/g
s/b/q/g
s/c/ɔ/g

and then:

echo "abc" | sed -f script.sed

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

巨坚强 2024-09-11 21:02:24

有些 Unicode 字符看起来与普通字母相似,并且是倒转的,例如:B 的倒转版本可以是“ᗺ”,它是加拿大音节载体 Kha 字符 (U+15FA),此网站 https://www.upsidedowntext.top/ 包含用于生成颠倒文本的所有反转 Unicode 字符的列表。

如需更多说明,您可以查看此字体生成器网站 https://fontgenerator.cc/,它创建了许多其他花哨的字体使用不同 Unicode 字符的样式。

您可以通过使用普通字母表作为键、使用 Unicode 字符作为值来初始化映射来实现此目的。之后,您所要做的就是获取用户输入并将每个输入字符转换为映射中对应的 Unicode 字符值。

  "upsideDown": {
    "A": "Ɐ",
    "B": "ᗺ",
    "C": "Ɔ",
    "D": "ᗡ",
    "E": "Ǝ",
    "F": "Ⅎ",
    "G": "⅁",
    "H": "H",
    "I": "I",
    "J": "ᒋ",
    "K": "ꓘ",
    "L": "⅂",
     ....
     }

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.

  "upsideDown": {
    "A": "Ɐ",
    "B": "ᗺ",
    "C": "Ɔ",
    "D": "ᗡ",
    "E": "Ǝ",
    "F": "Ⅎ",
    "G": "⅁",
    "H": "H",
    "I": "I",
    "J": "ᒋ",
    "K": "ꓘ",
    "L": "⅂",
     ....
     }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文