That is not an important problem, becouse I always can use construction like
Code: Select all
(map decode-utf8-to-cp1251 (directory "."))
Code: Select all
(map decode-utf8-to-cp1251 (directory "."))
You can use iconv in Windows too. A lot of Unix-like applications for Windows comes with iconv library today: in my system there are... let me count... six instances of iconv.dll (yes, this IS the dll hell!). If you have no one, download it form GnuWin32 (the library file is named libiconv2.dll in this package, but it is all the same). The library interface is a bit low-level, but newLISP is doing a very good job accessing low-level interfaces. The following code is demo, but it works for me:Fritz wrote:I just want to ask about future politics: will newLISP in the future have an operator like *nix iconv
Code: Select all
(import "iconv.dll" "libiconv_open") ; see 1
(import "iconv.dll" "libiconv")
(import "iconv.dll" "libiconv_close")
(setq cd (libiconv_open "cp866" "utf-8")) ; see 2, 3
(setq in ((directory ".") -1)) ; see 4
(setq out (pack "n1024")) ; see 5
(setq inbuf (pack "lu" (address in)))
(setq inlen (pack "lu" (length in)))
(setq outbuf (pack "lu" (address out)))
(setq outlen (pack "lu" (length out)))
(libiconv cd (address inbuf) (address inlen) (address outbuf) (address outlen))
(libiconv_close cd)
(println out)
(exit)
Code: Select all
(setq result (slice out 0 (- (length out) (get-int outlen))))
(println result)
GIMP iconv.dll made this for me! Thanx!Cyril wrote:(import "iconv.dll" "libiconv")
Code: Select all
(setq inbuf (pack "lu" in))
(setq inlen (pack "lu" (length in)))
(setq outbuf (pack "lu" out))
(setq outlen (pack "lu" (length out)))
(libiconv cd inbuf inlen outbuf outlen)
Code: Select all
(libiconv_open "cp866" "utf-8")
Code: Select all
(let ((IN "CP866") (OUT "UTF-8")) (libiconv_open (address IN) (address OUT)))