[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filename(CJK utf8) problem on OSX.

From: Park SungMin
Subject: filename(CJK utf8) problem on OSX.
Date: Mon, 28 Mar 2016 10:21:46 +0900

follow code….. I just test openfile(CJK filename).
"open-file" and "call-with-input-file" are raise error.  so I test use low 
C(Posix) API, then run ok!
I don’t know is it bug? or option problem?

(use-modules  (rnrs io ports)
                        (rnrs bytevectors)
                        (system foreign)
                        (ice-9 rdelim))

(fluid-set! %default-port-encoding "utf-8")
(set-port-encoding! (current-output-port) "utf-8")
(set-port-encoding! (current-input-port) "utf-8")

(define filename "/Users/byul/Desktop/사진.gif")

(define my-open-file
  (lambda (filename)
    (let* ((fd ((pointer->procedure
                 (dynamic-func "open" (dynamic-link))
                 (list '* int))
                 (string->utf8 filename))
      (when (= fd -1)
        (throw 'can't-find-file))
      (fdes->inport fd))))

(define port (my-open-file filename))

(get-bytevector-n port 10)  ;; OK. I get bytevector.

(file-exists? filename) ;; #f
(open-file filename "r") ; ERROR: In procedure open-file: No such file or 
directory: "/Users/byul/Desktop/사진.gif"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]