(with-open-file (s "~/例子.txt"
:external-format :utf-8)
(print s))
result:
NIL c-string encoding error:
the character with code 20363 cannot be encoded.
[Condition of type SB-INT:C-STRING-ENCODING-ERROR]
Example:
in Aquamacs 3.5 with newest slime & sbcl2.0.2:
sbcl in iterm2 can do it:
Aquamacs itself can open and write filename contains utf-8 correctly, too.
I have tried to add
(setq slime-net-coding-system 'utf-8-unix)
(set-language-environment "UTF-8")
in my aquamacs config file, but it doesn't work. Please help!
Update: I have finally found the reason. When in Iterm2, the command
locale
While in Aquamacs open from ui, in eshell it gives:
After I added:
(setenv "LANG" "en_US.UTF-8")
to my Aquamacs config, it works! Thanks to all who reply to my question! Below is the links that helps me.
Add something like:
(setenv "LANG" "en_US.UTF-8")
to your emacs config. Explain is at above.