A new function EXT:ALL-ENCODINGS lists all encondings known to ECL.

parent 99db7a30
......@@ -106,6 +106,8 @@ and important fixes to let ECL work better with Slime.
- COMPILE-FILE admits the keyword argument :EXTERNAL-FORMAT.
- A new function EXT:ALL-ENCODINGS lists all encondings known to ECL.
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***
......
......@@ -1780,6 +1780,7 @@ cl_symbols[] = {
{EXT_ "LOAD-ENCODING", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "MAKE-ENCODING", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "ALL-ENCODINGS", EXT_ORDINARY, NULL, -1, OBJNULL},
{KEY_ "US-ASCII", KEYWORD, NULL, -1, OBJNULL},
{KEY_ "LITTLE-ENDIAN", KEYWORD, NULL, -1, OBJNULL},
......
......@@ -1780,6 +1780,7 @@ cl_symbols[] = {
{EXT_ "LOAD-ENCODING",NULL},
{EXT_ "MAKE-ENCODING",NULL},
{EXT_ "ALL-ENCODINGS",NULL},
{KEY_ "US-ASCII",NULL},
{KEY_ "LITTLE-ENDIAN",NULL},
......
......@@ -283,6 +283,21 @@ the one used internally by ECL compiled files."
,object ,stream ,type ,identity #'.print-unreadable-object-body.))
`(print-unreadable-object-function ,object ,stream ,type ,identity nil)))
(let* ((basic-encodings
#+unicode
'(:UTF-8 :UCS-2 :UCS-2BE :UCS-2LE :UCS-4 :UCS-4BE
:ISO-8859-1 :LATIN-1 :US-ASCII :DEFAULT)
#-unicode
'(:DEFAULT))
(all-encodings nil))
(defun ext:all-encodings ()
(or all-encodings
(progn
(setf all-encodings basic-encodings)
(dolist (i (directory "sys:encodings;*"))
(push (intern (pathname-name i) "KEYWORD") all-encodings))
all-encodings))))
(defun ext:load-encoding (name)
(let ((filename (make-pathname :name (symbol-name name) :defaults "sys:encodings;")))
(cond ((probe-file filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment