暗无天日

=============>DarkSun的个人博客

查看某个字符的Unicode的方法

有时候想要查看某个特殊符号的Unicode,在Emacs中你只需要将光标移动到符号上,然后按下 C-x = 或者 M-x what-cursor-position,就能在echo area中看到符号对应的Unicode了。

比如想我想知道 © 的Unicode是什么,那么按下 C-x = 后会在echo area中显示

Char: © (169, #o251, #xa9, file ...) point=371 of 529 (70%) column=8

你还可以为 what-cursor-position 带上前缀参数以显示更加详细的信息,比如按下 C-4 C-x =, 会弹出一个新窗口,包含以下内容

             position: 371 of 529 (70%), column: 8
            character: © (displayed as ©) (codepoint 169, #o251, #xa9)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0xA9
               script: latin
               syntax: _ 	which means: symbol
             category: .:Base, j:Japanese, l:Latin
             to input: type "C-x 8 RET a9" or "C-x 8 RET COPYRIGHT SIGN"
          buffer code: #xC2 #xA9
            file code: #xC2 #xA9 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x6B)

Character code properties: customize what to show
  name: COPYRIGHT SIGN
  general-category: So (Symbol, Other)
  decomposition: (169) ('©')

There is an overlay here:
 From 363 to 435
  face                 hl-line
  priority             -50
  window               #<window 142 on 查看某个字符的Unicode.org>


There are text properties here:
  face                 (:inherit (org-block))
  font-lock-fontified  t
  font-lock-multiline  t
  fontified            t
  line-prefix          ""
  wrap-prefix          [Show]

[back]

从中的 to input: 一行中甚至还能看到该字符的输入方法.