From: Bruno H. <br...@cl...> - 2003-09-28 08:38:30
|
Sam wrote: > sys::set-foreign-encoding checks that the encoding is 1:1. > -Eforeign does not. > therefore > > clisp -q -E utf-8 > (setq *foreign-encoding* *foreign-encoding*) > ==> error! Interesting contradiction :-) > what should be done about this? Given that it's quite important that "clisp -q -E utf-8" starts up without an error message... I'd say: Hacked solution: Define a function sys::set-foreign-encoding-or-ascii which sets O(foreign_encoding) to either the argument, if it is 1:1, or to ASCII. Call this function from the startup routine. The problem with this approach is that you cannot pass any non-ASCII string through the FFI. Right solution: Change foreign.d to not assume that O(foreign_encoding) is 1:1. Yes this implies some changes to the FFI. char[n] means n bytes, maybe fewer than n characters. Bruno |