What is the unicode character for the close symbol used by Twitter bootstrap?

后端 未结 7 1753
走了就别回头了
走了就别回头了 2021-01-29 23:17

Just curious, because I just realized it wasn\'t an actual \"x\" (annoying how long that took to figure out).

7条回答
  •  你的背包
    2021-01-29 23:49

    It uses ×.

    You can use the following to obtain the desired information about any character:

    $ perl -Mcharnames=:full -CA -e'
       printf("U+%04X %s\n", $_, charnames::viacode($_))
          for unpack "W*", $ARGV[0];
    ' ×
    U+00D7 MULTIPLICATION SIGN
    

    If you're going to use it in HTML, you can encode it as follows:

    $ perl -MHTML::Entities -CA -e'
       CORE::say encode_entities($ARGV[0]);
    ' ×
    ×
    

    Notes:

    • The above programs expect the argument to be encoded using UTF-8.
    • The line breaks can be removed to make true one-liners.

提交回复
热议问题