On Thursday, April 19, 2012 8:36:44 PM UTC-7,
zea...@126.com wrote:
> I am a Chinese clisp user, working on Windows Chinese Edition with
> Emacs23.
>
> I have found that clisp' s implementation of parse-namestring can not
> handle
> pathname string which includes Chinese characters correctly.
...
> Alternatively, I set all my encodings to utf-8:
>
> clisp -E UTF-8
>
> But, when I call the function:
>
> (parse-namestring "F:/工具")
>
> I get the right result, but there still are OTHER characters can not
> be
> handled. You can use the codes above again to get another Characters
> list
> which can't be handled in UTF-8 encoding under Windows Chinese
> Edition.
>
> I try the same function calls in Ubuntu, and always get the right
> result.
>
> Maybe that's a BUG? Or I missed something?
...
> Maybe I can not use clisp in Windows?
Possibly.
I also know nothing about the file system interface in Windows and whether that can properly support utf-8 character encodings.
You might want to try your question on a clisp specific bug mailing list like clisp-devel
But the other thing to look into is to make sure that the input you are giving clisp is actually proper utf-8 encoding.
If you are reading the forms from a file, you need to make sure the file is saved in utf-8 format.
For starters, then, I would put the PARSE-NAMESTRING inside another test function whose name consists only of ascii characters. That will let you test without worrying about how the typing gets encoded into characters. Put that function in a text file and make sure the text file is properly saved in utf-8 format. Load the test file and try to call your test function.
If you are typing the characters at the terminal interactively, you would need to make sure that the characters that are passed are really proper utf-8 characters.
I would start by trying to examine the string that you use for the name and making sure that it is a proper utf-8 string. That will likely require you to use some clisp specific functions to look at the string and its encoding.