log4erl:info("~p", ["中文"]).
會報錯,于是看了下log4erl:info的實(shí)現(xiàn),log4erl在寫文件時候:
M = log_formatter:format(Log, Format),
file:write(Fd, M);
erlang文檔中定義,不能輸出大于255的字符。

那要如何輸出中文呢?
可以通過xmerl_ucs:to_utf8 來轉(zhuǎn)換。
BTW:unicode 通常指的是ucs-2的具體實(shí)現(xiàn),不同于utf-8.