This library allows you to use ASDF with Lisp source files
that use an encoding different from either ASCII or UTF-8.
-It depends on ASDF 2.21 or later (actually 2.20.7 or later)
+It depends on ASDF 2.21 or later (actually 2.20.7 or later).
TODO:
-(1) actually support more than utf-8, latin1 and default.
+(1) actually support more implementations.
(2) Add a test suite.
-(3) test it on more than sbcl, ccl, clisp.
+(3) Test it.
==== Exported Functionality ====
depending on asdf-encodings.
-ENCODING-EXTERNAL-FORMAT (ENCODING)
+function ENCODING-EXTERNAL-FORMAT (ENCODING &KEY (ON-ERROR *ON-UNSUPPORTED-ENCODING*))
This function takes a keyword which is one of
:default
:utf-8 :utf8
:latin1 :latin-1 :iso-8859-1
+ a whole lot of other possibilities as per asdf-encodings::*encodings*
and returns a value suitable for use as :external-format argument to
the current implementation's CL:OPEN, CL:LOAD or CL:COMPILE-FILE functions.
+ If the encoding is not supported on this implementation, the ON-ERROR
+ argument, which is one of :ERROR, :WARN, NIL, specifies what to do.
:iso_8859-1 :iso-ir-100 :csISOLatin1 :ibm819 :cp819 :windows-28591)
(:iso-8859-2 :iso8859-2 :latin2 :latin-2) ; eastern european; not to be confused with dos-cp852
(:iso-8859-3 :iso8859-3 :latin3 :latin-3) ; esperanto, maltese, (turkish)
- (:iso-8859-4 :iso8859-4 :latin-4 :latin4) ; prefer latin6, utf-8.
+ (:iso-8859-4 :iso8859-4 :latin4 :latin-4) ; prefer latin6, utf-8.
(:iso-8859-5 :iso8859-5) ; cyrillic; prefer koi8-r, or utf-8
(:iso-8859-6 :iso8859-6) ; arabic
(:iso-8859-7 :iso8859-7 :ecma-118) ; greek
#+scl
(defun find-implementation-encoding (encoding)
- (and (or (lisp::encoding-character-width encoding)
- (member encoding '(:utf-8 :utf-16 :utf-16le :utf-16be)))
+ (and (or (lisp::encoding-character-width encoding) ; only works for fixed-width
+ (member encoding '(:utf-8 :utf-16 :utf-16le :utf-16be))) ; more may exist
encoding))
#-(or lispworks scl)
(setf asdf:*encoding-external-format-hook* 'encoding-external-format)
(values))
-
;;; Load-time Initialization.
(initialize-normalized-encodings)
(register-asdf-encodings)