2009/08/13

What's Byte Order Mark (BOM) in Unicode

When a BOM is used, is it only in 16-bit Unicode text?

A: No, a BOM can be used as a signature no matter how the Unicode text is transformed: UTF-16, UTF-8, UTF-7, etc. The exact bytes comprising the BOM will be whatever the Unicode character FEFF is converted into by that transformation format. In that form, the BOM serves to indicate both that it is a Unicode file, and which of the formats it is in. Examples:

Bytes Encoding Form
00 00 FE FF UTF-32, big-endian
FF FE 00 00 UTF-32, little-endian
FE FF UTF-16, big-endian
FF FE UTF-16, little-endian
EF BB BF UTF-8

链接是 UTF系列问题的权威解答FAQ,强烈建议阅读!

VIM unicode

在 MS Windows 下面由于受 Byte Order Mark (BOM) 的控制, 需要对GVIM 做一些配置才能正常工作。 这包括 tenc, enc, fencs, guifont, guifontwide。 这样一来,vim就可以自动 根据BOM做出正确的显示了,同时也可以自动识别GBK和BIG5。


if has("multi_byte")
set encoding=unicode
let &termencoding = &encoding
" Set default encoding as UTF-8 with BOM
setglobal fileencoding=utf-8 bomb
" Auto detect the file encoding BOM unicode, utf-8, GBK, Big5, Latin1
set fileencodings=ucs-bom,utf-8,cp936,cp950,latin1

" Walkaround the encoding problem for fenc=utf-8 && enc=ucs-2
augroup i18n
autocmd!
autocmd BufReadPost * if &fileencoding == "utf-8" | let &encoding = &fileencoding | endif
augroup END
endif

" Enable the Chinese characters
"set guifont=Bitstream\ Vera\ Sans\ Mono:h10:cANSI,NSimSun:h11:cGB2312
set guifont=Consolas:h11:cANSI,NSimSun:h11:cGB2312
set guifontwide=NSimSun:h11:cGB2312

2009/08/12

Google Wave Sandbox

This is the first time for me to use Google Wave. It looks a little strange as a fresh user. We MUST fully understand "what is a WAVE?"
  • IM?
  • Word?
  • Blog?
  • twitter?
  • SNS?
Are you understanding this? It might be better if there are some others in my Wave. I need to take a look at the Google Wave API to find more.

It just likes someone said, "It looks more like a Microsoft product, not Google!" I think, it still takes time to figure out "What's a Wave?"

BlockChain 相关电子书

@copyright of Sam Chadwick   - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...