How to pass unicode string to sys:call-system
Hi,
I'm failing to pass a path containing unicode characters as an argument
to call-system on Linux:
```
CL-USER 60 > (sys:call-system '("/usr/bin/xdg-open" "/home/fourier/мой_файл.png"))
Error: #\м (of type character) is not of type base-char.
1 (abort) Return to top loop level 0.
```
I've tried to convert the string to utf8 and then to base-string but
apparently the argument was not accepted by the system either:
(defun string-to-base-string (str)
(loop with len = (length str)
with result = (make-string len :element-type 'base-char)
for n across (babel:string-to-octets str :encoding :utf-8)
for i below len
do (setf (schar result i) (code-char n))
finally (return result)))
CL-USER 66 > (sys:call-system (list "/usr/bin/xdg-open" (string-to-base-string "/home/fourier/мой_файл.png")))
4
Even then the file is clearly there.
System locale is UTF-8
LANG=en_US.UTF-8
Any ideas how to pass the unicode string as a command line argument to
call-system ?
--
Br,
/Alexey
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html