moved find-output-encoding to closure-common, thanks to Nathan Bird
This commit is contained in:
committed by
David Lichteblau
parent
fc832df789
commit
294e93c3a8
@ -65,6 +65,7 @@
|
|||||||
;; ystream.lisp
|
;; ystream.lisp
|
||||||
#:ystream
|
#:ystream
|
||||||
#:ystream-encoding
|
#:ystream-encoding
|
||||||
|
#:find-output-encoding
|
||||||
#:close-ystream
|
#:close-ystream
|
||||||
#:ystream-write-rune
|
#:ystream-write-rune
|
||||||
#:ystream-write-rod
|
#:ystream-write-rod
|
||||||
|
|||||||
21
ystream.lisp
21
ystream.lisp
@ -25,6 +25,27 @@
|
|||||||
(defmacro until (test &body body)
|
(defmacro until (test &body body)
|
||||||
`(do () (,test) ,@body))
|
`(do () (,test) ,@body))
|
||||||
|
|
||||||
|
(defun find-output-encoding (name)
|
||||||
|
(when (stringp name)
|
||||||
|
(setf name (find-symbol (string-upcase name) :keyword)))
|
||||||
|
(cond
|
||||||
|
((null name)
|
||||||
|
(warn "Unknown encoding ~A, falling back to UTF-8" name)
|
||||||
|
:utf-8)
|
||||||
|
((find name '(:utf-8 :utf_8 :utf8))
|
||||||
|
:utf-8)
|
||||||
|
#-rune-is-character
|
||||||
|
(t
|
||||||
|
(warn "Unknown encoding ~A, falling back to UTF-8" name)
|
||||||
|
:utf-8)
|
||||||
|
#+rune-is-character
|
||||||
|
(t
|
||||||
|
(handler-case
|
||||||
|
(babel-encodings:get-character-encoding name)
|
||||||
|
(error ()
|
||||||
|
(warn "Unknown encoding ~A, falling back to UTF-8" name)
|
||||||
|
:utf-8)))))
|
||||||
|
|
||||||
;;; ystream
|
;;; ystream
|
||||||
;;; +- encoding-ystream
|
;;; +- encoding-ystream
|
||||||
;;; | +- octet-vector-ystream
|
;;; | +- octet-vector-ystream
|
||||||
|
|||||||
Reference in New Issue
Block a user