-K kcode Specifies KANJI (Japanese) encoding. The default value for script encodings (__ENCODING__) and external encodings (Encoding.default_external) will be the specified one. kcode can be one of
e EUC-JP
s Windows-31J (CP932)
u UTF-8
n ASCII-8BIT (BINARY)
ruby1.9 直接在文件头
#encoding: utf-8
就可以处理中文了