|
From: Sam S. <sd...@gn...> - 2005-06-24 14:10:52
|
> * Hoehle, Joerg-Cyril <Wbr...@g-...> [2005-06-24 15:34:23 +0200]: > > Bruno Haible wrote on 21. Mai 2002 >>> > Obviously, having correct min/max is the "better" solution. >>Yes, it would, but it is too much maintenance overhead, given that >>iconv by itself doesn't provide this information. > > It's time to raise this thread again because whoever (Sam?) added the > non-1:1 support to the FFI will run into this issue. 2004-12-24 Bruno Haible <br...@cl...> Support multibyte encodings in FFI:*FOREIGN-ENCODING*. * encoding.d (init_dependent_encodings): Remove warning if *FOREIGN-ENCODING* is not 1:1. Initialize O(foreign_8bit_encoding). (SYSTEM::SET-FOREIGN-ENCODING): Update O(foreign_8bit_encoding). * foreign.d (convert_from_foreign_array_fill): For characters, use O(foreign_8bit_encoding). (convert_from_foreign): Likewise. Add special conversion routines for (C-ARRAY CHARACTER dim1), (C-ARRAY-MAX CHARACTER maxdim), (C-ARRAY-PTR CHARACTER). (count_walk_pre): For C-STRING and (C-ARRAY-PTR CHARACTER ...), compute the amount of needed memory. (convert_to_foreign): For characters, use O(foreign_8bit_encoding). Add special conversion routines for (C-ARRAY CHARACTER dim1), (C-ARRAY-MAX CHARACTER maxdim), (C-ARRAY-PTR CHARACTER). > That's why I invented SYS::ENCODING-ZEROES, which I needed for > WITH-FOREIGN-STRING. my position holds: ENCODING-ZEROES must be implemented in C and use & update min/max_bytes_per_char. specifically: 1. ENCODING-ZEROES should be removed 2. code similar to that in ENCODING-ZEROES should be invoked by MAKE-ENCODING and fill the min/max_bytes_per_char slots. 3. call-with-foreign-string should not accept "extra-zeroes" but use min/max_bytes_per_char. the more radical approach would be to incorporate the extra-zeroes into cstombs at al. -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.mideasttruth.com/> <http://www.honestreporting.com> <http://www.memri.org/> <http://www.dhimmi.com/> <http://www.camera.org> The world will end in 5 minutes. Please log out. |