Programming

SBCL 에 대한 실망

steloflute 2021. 4. 5. 23:46

윈도우에서 quicklisp 로 cl-ppcre, dexador 도 깔고 웹 스크레이핑도 가능하게 되었는데, (예전에는 http client 로 drakma 설치시 에러가 났었다.)

 

한글 출력이 문제다. UTF-8 로 해도 소용 없었다.

 

>copy con test.lisp
(format t "가나다~%")
^Z
        1개 파일이 복사되었습니다.

>sbcl --script test.lisp
°¡³ª´Ù

나가시는 문은 저쪽입니다.

리눅스에서는 한글이 잘 출력된다.

윈도우에서, 소스 코드를 UTF-8 인코딩으로 저장하고
sbcl --eval "setf sb-impl::*default-external-format* :utf-8" --load test.lisp
로 하면 되긴 한다. 소스 코드 로딩 전에 세팅되어야 하기 때문에 소스 코드 상단에 저걸 넣어도 소용 없다.

 

SBCL 2.1.10에서 고쳐졌다. 기본 인코딩이 UTF-8이어서 UTF-8 소스 코드의 한글이 그냥 잘 출력된다. (EUC-KR로 하면 에러 남) 이게 맞다. 늦은 감이 있는데 요즘 시대에 기본 인코딩이 미국 인코딩이었다니...

>sbcl
This is SBCL 2.1.10, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* sb-impl::*default-external-format*
:UTF-8

'Programming' 카테고리의 다른 글

(F#) 비동기 프로그래밍  (0) 2021.05.12
(Free Pascal) catch runtime error  (0) 2021.04.10
How to convert string to int in C#?  (0) 2021.04.05
Common Lisp을 위한 정규표현식  (0) 2021.03.30
(Common Lisp) 라이브러리 설치하기  (0) 2021.03.29