diff --git a/bootfiles/20a/boot-2010-07-1.lisp b/bootfiles/20a/boot-2010-07-1.lisp new file mode 100644 index 0000000000000000000000000000000000000000..557ded2661b28f976e684bf27e673452556bbf9f --- /dev/null +++ b/bootfiles/20a/boot-2010-07-1.lisp @@ -0,0 +1,34 @@ +;; Simple bootstrap file to add the documentation slot to the EFX and +;; EXTERNAL-FORMAT structure. + +(in-package "STREAM") + +(ext:without-package-locks + (handler-bind ((error (lambda (c) + (declare (ignore c)) + (invoke-restart 'kernel::clobber-it)))) + #+nil + (defstruct efx + (octets-to-code #'%efni :type function :read-only t) + (code-to-octets #'%efni :type function :read-only t) + (flush-state nil :type (or null function) :read-only t) + (copy-state nil :type (or null function) :read-only t) + (cache nil :type (or null simple-vector)) + (min 1 :type kernel:index :read-only t) + (max 1 :type kernel:index :read-only t) + (documentation nil :type (or null string) :read-only t))) + + (handler-bind ((error (lambda (c) + (declare (ignore c)) + (invoke-restart 'kernel::clobber-it)))) + (defstruct (external-format + (:conc-name ef-) + (:print-function %print-external-format) + (:constructor make-external-format (name efx composingp documentation + &optional slots slotd))) + (name (ext:required-argument) :type (or keyword cons) :read-only t) + (efx (ext:required-argument) :type efx :read-only t) + (composingp (ext:required-argument) :type boolean :read-only t) + (slots #() :type simple-vector :read-only t) + (slotd nil :type list :read-only t) + (documentation nil :type (or null string) :read-only t)))) \ No newline at end of file diff --git a/code/exports.lisp b/code/exports.lisp index 0a9bb1da44a4bd9428d3673cf66219b21f081b66..465582e29e93dc17bcc98a4d05a81375cc0912b9 100644 --- a/code/exports.lisp +++ b/code/exports.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.297 2010/07/10 22:50:58 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.298 2010/07/12 13:58:42 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1251,9 +1251,9 @@ ;; Make these STREAM symbols available (dolist (name - '("STRING-TO-OCTETS" "OCTETS-TO-STRING" "*DEFAULT-EXTERNAL-FORMAT*" - "STRING-ENCODE" "STRING-DECODE" "SET-SYSTEM-EXTERNAL-FORMAT" - "LIST-ALL-EXTERNAL-FORMATS")) + '("STRING-TO-OCTETS" "OCTETS-TO-STRING" "*DEFAULT-EXTERNAL-FORMAT*" + "STRING-ENCODE" "STRING-DECODE" "SET-SYSTEM-EXTERNAL-FORMAT" + "LIST-ALL-EXTERNAL-FORMATS" "DESCRIBE-EXTERNAL-FORMAT")) (intern name "STREAM")) (defpackage "EXTENSIONS" @@ -1484,7 +1484,8 @@ "STRING-TO-OCTETS" "OCTETS-TO-STRING" "*DEFAULT-EXTERNAL-FORMAT*" "STRING-ENCODE" "STRING-DECODE" "SET-SYSTEM-EXTERNAL-FORMAT" - "LIST-ALL-EXTERNAL-FORMATS") + "LIST-ALL-EXTERNAL-FORMATS" + "DESCRIBE-EXTERNAL-FORMAT") ;; Unicode (:export "STRING-TO-OCTETS" "OCTETS-TO-STRING" "*DEFAULT-EXTERNAL-FORMAT*" "LIST-ALL-EXTERNAL-FORMATS" @@ -1555,7 +1556,8 @@ "STRING-ENCODE" "STRING-DECODE" "SET-SYSTEM-EXTERNAL-FORMAT" "+REPLACEMENT-CHARACTER-CODE+" - "LIST-ALL-EXTERNAL-FORMATS")) + "LIST-ALL-EXTERNAL-FORMATS" + "DESCRIBE-EXTERNAL-FORMAT")) (defpackage "LOOP") (dolist diff --git a/code/extfmts.lisp b/code/extfmts.lisp index 753b3a780f56a29806fc8a55b5c275461947141c..5d0aaa87957be5190fdd3bd7dd82487e27869bf3 100644 --- a/code/extfmts.lisp +++ b/code/extfmts.lisp @@ -5,7 +5,7 @@ ;;; domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.34 2010/07/10 22:50:58 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.35 2010/07/12 13:58:42 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -18,7 +18,8 @@ (export '(string-to-octets octets-to-string *default-external-format* string-encode string-decode set-system-external-format +replacement-character-code+ - list-all-external-formats)) + list-all-external-formats + describe-external-format)) (defvar *default-external-format* :iso8859-1 @@ -58,6 +59,14 @@ (declare (ignore condition)) (format stream (intl:gettext "Attempting unimplemented external-format I/O."))))) +(define-condition external-format-not-found (error) + ((name :reader external-format-not-found-name + :initarg :name)) + (:report + (lambda (condition stream) + (format stream (intl:gettext "External format ~S not found.") + (external-format-not-found-name condition))))) + (defun %efni (a b c d) (declare (ignore a b c d)) (error 'external-format-not-implemented)) @@ -86,18 +95,22 @@ (min 1 :type kernel:index :read-only t) ;; ;; Maximum number of octets needed to form a codepoint. - (max 1 :type kernel:index :read-only t)) + (max 1 :type kernel:index :read-only t) + ;; + ;; Documentation for this external format + #+nil(documentation nil :type (or null string) :read-only t)) (defstruct (external-format (:conc-name ef-) (:print-function %print-external-format) - (:constructor make-external-format (name efx composingp + (:constructor make-external-format (name efx composingp documentation &optional slots slotd))) (name (ext:required-argument) :type (or keyword cons) :read-only t) (efx (ext:required-argument) :type efx :read-only t) (composingp (ext:required-argument) :type boolean :read-only t) (slots #() :type simple-vector :read-only t) - (slotd nil :type list :read-only t)) + (slotd nil :type list :read-only t) + (documentation nil :type (or null string) :read-only t)) (defun %print-external-format (ef stream depth) (declare (ignore depth)) @@ -147,17 +160,21 @@ ;;; DEFINE-EXTERNAL-FORMAT -- Public ;;; -;;; name (&key min max size) (&rest slots) octets-to-code code-to-octets -;;; flush-state copy-state +;;; name (&key base min max size documentation) (&rest slots) octets-to-code +;;; code-to-octets flush-state copy-state +;;; +;;; Define a new external format. If base is specified, then an +;;; external format is defined that is based on a previously defined +;;; external format named Base. The slot names used in Slots must +;;; match those defined in the Base format. ;;; -;;; Define a new external format. Min/Max/Size are the minimum and -;;; maximum number of octets that make up a character (:size N is just -;;; shorthand for :min N :max N). Slots is a list of slot descriptions -;;; similar to defstruct. +;;; If Base is not specified, a new external format is defined. +;;; Min/Max/Size are the minimum and maximum number of octets that +;;; make up a character (:size N is just shorthand for :min N :max +;;; N). Slots is a list of slot descriptions similar to defstruct. ;;; -;;; name (base) (&rest slots) -;;; Define an external format based on a previously-defined external -;;; format, Base. The slot names used in Slots must match those in Base. +;;; In both cases, Documentation is a string that documents the +;;; external format. ;;; ;;; octets-to-code (state input unput error &rest vars) ;;; Defines a form to be used by the external format to convert @@ -213,28 +230,24 @@ ;;; process characters outside the Lisp range (see ;;; CODEPOINT-TO-OCTETS, OCTETS-TO-CODEPOINT) ;;; -(defmacro define-external-format (name (&rest args) (&rest slots) +(defmacro define-external-format (name (&key base min max size (documentation "")) + (&rest slots) &optional octets-to-code code-to-octets flush-state copy-state) - (when (and (oddp (length args)) (not (= (length args) 1))) - (warn (intl:gettext "Nonsensical argument (~S) to DEFINE-EXTERNAL-FORMAT.") args)) (let* ((tmp (gensym)) - (min (if (evenp (length args)) - (or (getf args :min) (getf args :size) 1) - 1)) - (max (if (evenp (length args)) - (or (getf args :max) (getf args :size) 6) - 6)) - (base (if (= (length args) 1) - (find-external-format (first args)) - nil)) + (min (or min size 1)) + (max (or max size 6)) + (base (when base + (find-external-format base))) (bslotd (if base (ef-slotd base) nil)) (slotd (%merge-slots bslotd slots)) (slotb (loop for slot in slotd collect `(,(first slot) `(the ,',(fourth slot) ;; IDENTITY is here to protect against SETF - (identity (svref %slots% ,',(second slot)))))))) + (identity (svref %slots% ,',(second slot)))))))) + (when documentation + (intl::note-translatable intl::*default-domain* documentation)) `(macrolet ((octets-to-code ((state input unput error &rest vars) body) `(lambda (,state ,input ,unput ,error) (declare (ignorable ,state ,input ,unput ,error) @@ -274,8 +287,10 @@ :copy-state ,copy-state :cache (make-array +ef-max+ :initial-element nil) - :min ,(min min max) :max ,(max min max))) + :min ,(min min max) + :max ,(max min max))) nil + ,documentation (let* ,(loop for x in slotd collect (list (first x) (third x))) (vector ,@(mapcar #'first slotd))) @@ -290,11 +305,11 @@ ;;; to be of any use. ;;; ;;; -;;; name (&key min max size) input output +;;; name (&key min max size documentation) input output ;;; Defines a new composing external format. The parameters Min, -;;; Max, and Size are the same as for defining an external format. -;;; The parameters input and output are forms to handle input and -;;; output. +;;; Max, Size, and Documentation are the same as for defining an +;;; external format. The parameters input and output are forms to +;;; handle input and output. ;;; ;;; input (state input unput &rest vars) ;;; Defines a form to be used by the composing external format when @@ -319,7 +334,7 @@ ;;; value of the stream's state variable. Output is a form that ;;; writes one octet to the output stream. -(defmacro define-composing-external-format (name (&key min max size) +(defmacro define-composing-external-format (name (&key min max size documentation) input output) (let ((tmp (gensym)) (min (or min size 1)) @@ -347,6 +362,7 @@ :code-to-octets ,output :min ,(min min max) :max ,(max min max)) t + ,documentation #() '()))))) (defun load-external-format-aliases () @@ -395,6 +411,49 @@ ef) (sort result #'string< :key #'first))) +(defun describe-external-format (external-format) + "Print a description of the given External-Format. This may cause + the external format to be loaded (silently), if it is not already + loaded." + (when (zerop (hash-table-count + *external-format-aliases*)) + (load-external-format-aliases)) + (let ((alias (gethash external-format *external-format-aliases*))) + (cond (alias + (format t (intl:gettext "~&~S is an alias for the external format ~S.~2%") + external-format alias)) + ((and (listp external-format) + (> (length external-format) 1)) + ;; Some kind of composed external format + (format t (intl:gettext "~&~S is a composed external format.~2%") external-format)) + (t + (let ((ef (handler-case (let ((*compile-print* nil) + (ext:*compile-progress* nil) + (*compile-verbose* nil)) + ;; Should we be this silent when + ;; loading the external format? + ;; We aren't when the normally + ;; loading the format. + (find-external-format external-format)) + (external-format-not-found () + (format *error-output* + (intl:gettext "~&Could not find external format ~S~%") + external-format))))) + (when ef + (let (aliases) + ;; Find any aliases for this external format. Doesn't need to be efficient. + (maphash #'(lambda (k v) + (when (eq v external-format) + (push k aliases))) + *external-format-aliases*) + (format t (intl:gettext "~S~:[~; - [Aliases: ~{~S~^, ~}~]]~%") + external-format aliases aliases)) + (when (ef-composingp ef) + (format t (intl:gettext "~&~S is a composing external format.~2%") + external-format)) + (format t "~&~A~%" + (intl:gettext (or (ef-documentation ef) ""))))))))) + (defun %find-external-format (name) ;; avoid loading files, etc., early in the boot sequence (when (or (eq name :iso8859-1) @@ -461,6 +520,7 @@ :cache (make-array +ef-max+ :initial-element nil) :min (* (ef-min-octets a) (ef-min-octets b)) :max (* (ef-max-octets a) (ef-max-octets b))) + nil nil #() '())) (defun find-external-format (name &optional (error-p t)) @@ -479,7 +539,7 @@ (flet ((not-found () (when (equal *default-external-format* name) (setq *default-external-format* :iso8859-1)) - (if error-p (error (intl:gettext "External format ~S not found.") name) nil))) + (if error-p (error 'external-format-not-found :name name) nil))) (if (consp name) (let ((efs (mapcar #'%find-external-format name))) (if (member nil efs) @@ -568,19 +628,29 @@ (declare (ignore condition)) (format stream (intl:gettext "Attempting I/O through void external-format."))))) -(define-external-format :void (:size 0) () +(define-external-format :void (:size 0 :documentation +"Void external format that signals an error on any input or output.") + () (octets-to-code (state input unput error) `(error 'void-external-format)) (code-to-octets (code state output error) `(error 'void-external-format))) -(define-external-format :iso8859-1 (:size 1) () +(define-external-format :iso8859-1 (:size 1 :documentation +"ISO8859-1 is an 8-bit character encoding generally intended for +Western European languages including English, German, Italian, +Norwegian, Portuguese, Spanish, Swedish and many others. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") + () (octets-to-code (state input unput error) `(values ,input 1)) (code-to-octets (code state output error) `(,output (if (> ,code 255) (if ,error - (funcall ,error "Cannot output codepoint #x~X to ISO8859-1 stream" + (funcall ,error + (intl:gettext "Cannot output codepoint #x~X to ISO8859-1 stream") ,code 1) #x3F) ,code)))) @@ -684,10 +754,10 @@ (if ,error (if (lisp::surrogatep code) (funcall ,error - ,(format nil "Surrogate codepoint #x~~4,'0X is illegal for ~A" - external-format) + (format nil (intl:gettext "Surrogate codepoint #x~~4,'0X is illegal for ~A") + ,external-format) code nil) - (funcall ,error "Illegal codepoint on input: #x~X" code nil)) + (funcall ,error (intl:gettext "Illegal codepoint on input: #x~X") code nil)) #-(and unicode (not unicode-bootstrap)) #\? #+(and unicode (not unicode-bootstrap)) #\U+FFFD)) #+unicode @@ -718,7 +788,8 @@ (,wryte (if (lisp::surrogatep (char-code ,nchar) :low) (surrogates-to-codepoint (car ,nstate) ,nchar) (if ,error - (funcall ,error "Cannot convert invalid surrogate #x~X to character" + (funcall ,error + (intl:gettext "Cannot convert invalid surrogate #x~X to character") ,nchar) +replacement-character-code+))) (setf (car ,nstate) nil)) @@ -726,7 +797,8 @@ ;; the replacement character. (,wryte (if (lisp::surrogatep (char-code ,nchar) :low) (if ,error - (funcall ,error "Cannot convert lone trailing surrogate #x~X to character" + (funcall ,error + (intl:gettext "Cannot convert lone trailing surrogate #x~X to character") ,nchar) +replacement-character-code+) (char-code ,nchar))))))))) @@ -763,9 +835,9 @@ (buffer nil bufferp) error) "Convert String to octets using the specified External-format. The - string is bounded by Start (defaulting to 0) and End (defaulting to - the end of the string. If Buffer is given, the octets are stored - there. If not, a new buffer is created." + string is bounded by Start (defaulting to 0) and End (defaulting to + the end of the string. If Buffer is given, the octets are stored + there. If not, a new buffer is created." (declare (type string string) (type kernel:index start) (type (or kernel:index null) end) diff --git a/docs/cmu-user/unicode.tex b/docs/cmu-user/unicode.tex index ef65870bc1a079bd909164ad8d465a7b91964a0b..a2ba8c2b9ce52ff3cb8e09cb58b9d76e0c458167 100644 --- a/docs/cmu-user/unicode.tex +++ b/docs/cmu-user/unicode.tex @@ -549,6 +549,18 @@ utility functions are provided to make access easier. converting the octets. \end{defun} +\begin{defun}{}{list-all-external-formats}{} + \code{list-all-external-formats} produces a list of all known + external formats and the known aliases for for them. Each element + of the list is a list consisting of the name of the external format + and a list of the known aliases for the format. +\end{defun} + +\begin{defun}{}{describe-external-format}{\args \var{external-format}} + \code{describe-external-format} prints a description of the + specified external-format. +\end{defun} + \section{Writing External Formats} \subsection{External Formats} @@ -562,31 +574,34 @@ external format is defined using the macro \code{stream::define-external-format}. \begin{defmac}[base]{stream:}{define-external-format}{\args \var{name} - (\keys{\var{min} \var{max} \var{size}}) (\amprest{} \var{slots}) + (\keys{\var{base} \var{min} \var{max} \var{size} + \var{documentation}}) + (\amprest{} \var{slots}) \morekeys{\var{octets-to-code} \var{code-to-octets} \var{flush-state} \var{copy-state}}} - \defmacx[stream:]{define-external-format}{\args \var{name} - (\var{base}) (\amprest{} \var{slots})} - - The first defines a new external format of the name \kwd{name}. - \var{min}, \var{max}, and \var{size} are the minimum and maximum - number of octets that make up a character. (\code{\kwd{size} n} is - just a short cut for \code{\kwd{min} n \kwd{max} n}.) The arguments - \var{octets-to-code} and \var{code-to-octets} are not optional in - this case. They specify how to convert octets to codepoints and - vice versa, respectively. These should be backquoted forms for the - body of a function to do the conversion. See the description below - for these functions. Some good examples are the external format for + + + If \kwd{base} is not given, this defines a new external format of + the name \kwd{name}. \var{min}, \var{max}, and \var{size} are the + minimum and maximum number of octets that make up a character. + (\code{\kwd{size} n} is just a short cut for \code{\kwd{min} n + \kwd{max} n}.) The description of the external format can be + given using \kwd{documentation}. The arguments \var{octets-to-code} + and \var{code-to-octets} are not optional in this case. They + specify how to convert octets to codepoints and vice versa, + respectively. These should be backquoted forms for the body of a + function to do the conversion. See the description below for these + functions. Some good examples are the external format for \kwd{utf-8} or \kwd{utf-16}. The \kwd{slots} argument is a list of - read-only slots, similar to defstruct. The slot names are available as - local variables inside the \var{code-to-octets} and \var{octets-to-code} - bodies. + read-only slots, similar to defstruct. The slot names are available + as local variables inside the \var{code-to-octets} and + \var{octets-to-code} bodies. - The second form above defines an external format with the name - \kwd{name} that is based on a previously defined format \kwd{base}. - The \var{slots} are inherited from the \kwd{base} format by default, - although the definition may alter their values and add new slots. - See, for example, the \kwd{mac-greek} external format. + If \kwd{base} is given, then an external format is defined with the + name \kwd{name} that is based on a previously defined format + \kwd{base}. The \var{slots} are inherited from the \kwd{base} format + by default, although the definition may alter their values and add + new slots. See, for example, the \kwd{mac-greek} external format. \end{defmac} @@ -657,7 +672,7 @@ external format is defined using the macro \subsection{Composing External Formats} \begin{defmac}{stream:}{define-composing-external-format}{\args \var{name} - (\keys{\var{min} \var{max} \var{size}}) \var{input} + (\keys{\var{min} \var{max} \var{size} \var{documentation}}) \var{input} \var{output}} This is the same as \code{define-external-format}, except that a composing external format is created. diff --git a/general-info/release-20b.txt b/general-info/release-20b.txt index 1d6838d8855f57e510888803969d43459813ecea..171a449b8cd1e2f796c87dceee0c68e51c83e348 100644 --- a/general-info/release-20b.txt +++ b/general-info/release-20b.txt @@ -75,6 +75,10 @@ New in this release: function of 2 arguments: a message string and the offending codepoint. If the function returns, it must be the codepoint of the desired replacement. + - Add EXT:LIST-ALL-EXTERNAL-FORMATS to list all known external + formats and their aliases. + - ADD EXT:DESCRIBE-EXTERNAL-FORMAT to print a description of the + specified exernal format. * ANSI compliance fixes: - COMPILE will update the macro-function if the specified name diff --git a/pcl/simple-streams/external-formats/ascii.lisp b/pcl/simple-streams/external-formats/ascii.lisp index bd7b9986cdd95094a466f65686624934ce11d026..bf25a468074f330a9cb585c22f387419728e640f 100644 --- a/pcl/simple-streams/external-formats/ascii.lisp +++ b/pcl/simple-streams/external-formats/ascii.lisp @@ -4,11 +4,14 @@ ;;; This code was written by Raymond Toy and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/ascii.lisp,v 1.4 2010/07/07 13:04:04 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/ascii.lisp,v 1.5 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") -(define-external-format :ascii (:size 1) +(define-external-format :ascii (:size 1 :documentation +"US ASCII 7-bit encoding. Illegal input sequences are replaced with +the Unicode replacment character. Illegal output characters are +replaced with a question mark.") () (octets-to-code (state input unput error c) `(let ((,c ,input)) diff --git a/pcl/simple-streams/external-formats/beta-gk.lisp b/pcl/simple-streams/external-formats/beta-gk.lisp index f16dff267bd47f3776b9e2e75bbb7df983f086c7..f12a3d465c666070dc018a8d6b42e38d3ea62cfc 100644 --- a/pcl/simple-streams/external-formats/beta-gk.lisp +++ b/pcl/simple-streams/external-formats/beta-gk.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/beta-gk.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/beta-gk.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") ;; This is a composing format that translates (lower-case) Beta code ;; (an ASCII encoding of ancient Greek) into Unicode Greek. @@ -190,7 +190,10 @@ #(42 47) #(42 40)))))))) -(define-composing-external-format :beta-gk (:min 1 :max 6) ; 6?? +(define-composing-external-format :beta-gk (:min 1 :max 6 ; 6?? + :documentation +"A composing external format that translates (lower-case) Beta code +(an ASCII encoding of ancient Greek) into Unicode Greek.") (input (state input unput ch wd ent nch nwd nent) `(flet ((lookup (c map) (loop while map do diff --git a/pcl/simple-streams/external-formats/cp1250.lisp b/pcl/simple-streams/external-formats/cp1250.lisp index ed4994225148f2d9933ed40a4e1b4fac4b56a2c0..3d795ecc438b6a151d93d9e83f57af26c28a0a47 100644 --- a/pcl/simple-streams/external-formats/cp1250.lisp +++ b/pcl/simple-streams/external-formats/cp1250.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1250.lisp,v 1.3 2009/06/21 15:12:23 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1250.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -32,5 +32,11 @@ 324 328 243 244 337 246 247 345 367 250 369 252 253 355 729))) -(define-external-format :cp1250 (:mac-roman) +(define-external-format :cp1250 (:base :mac-roman :documentation +"CP1250 is a Windows code page to represent texts in Central and +Eastern European languages such as Polish, Czech, Slovak, Hungarian, +Slovene, Bosnian, Croation, Serbian, Romanian, and Albanian. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1250+))) diff --git a/pcl/simple-streams/external-formats/cp1251.lisp b/pcl/simple-streams/external-formats/cp1251.lisp index df95f2371721e1fce690ac8fd85b7cbf7cfcd1ad..782df2564db501d29f0b7329a31b3d069c3c005c 100644 --- a/pcl/simple-streams/external-formats/cp1251.lisp +++ b/pcl/simple-streams/external-formats/cp1251.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1251.lisp,v 1.3 2009/06/21 15:12:24 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1251.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -30,5 +30,11 @@ 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103))) -(define-external-format :cp1251 (:mac-roman) +(define-external-format :cp1251 (:base :mac-roman :documentation +"CP1251 is a Windows code page to represent texts that use the +Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic, and +others. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1251+))) diff --git a/pcl/simple-streams/external-formats/cp1252.lisp b/pcl/simple-streams/external-formats/cp1252.lisp index d48f914d2c896adfe26e6897b103b216b140dfd3..b7fc4f43341ada22fbee4948a9d63aeb9ce50247 100644 --- a/pcl/simple-streams/external-formats/cp1252.lisp +++ b/pcl/simple-streams/external-formats/cp1252.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1252.lisp,v 1.4 2009/08/17 17:47:13 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1252.lisp,v 1.5 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -28,5 +28,9 @@ 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255))) -(define-external-format :cp1252 (:mac-roman) +(define-external-format :cp1252 (:base :mac-roman :documentation +"CP1252 is a Windows code page for the Latin alphabet. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1252+))) diff --git a/pcl/simple-streams/external-formats/cp1253.lisp b/pcl/simple-streams/external-formats/cp1253.lisp index 7aceab46e285fa426fe3b0a71cb86248ef7848e3..62ad03870575b98a9b8ae17b24864b0f51212e8b 100644 --- a/pcl/simple-streams/external-formats/cp1253.lisp +++ b/pcl/simple-streams/external-formats/cp1253.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1253.lisp,v 1.3 2009/06/21 14:03:09 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1253.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -31,5 +31,9 @@ 963 964 965 966 967 968 969 970 971 972 973 974 65534))) -(define-external-format :cp1253 (:mac-roman) +(define-external-format :cp1253 (:base :mac-roman :documentation +"CP1253 is a Windows code page for Greek. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1253+))) diff --git a/pcl/simple-streams/external-formats/cp1254.lisp b/pcl/simple-streams/external-formats/cp1254.lisp index 68085630482a810928bda5a2c6ac4c412a1c9f6a..2afccb2d60d2f3e44c4f4e215b085afd052da6d5 100644 --- a/pcl/simple-streams/external-formats/cp1254.lisp +++ b/pcl/simple-streams/external-formats/cp1254.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1254.lisp,v 1.3 2009/06/21 15:12:24 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1254.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -30,5 +30,9 @@ 287 241 242 243 244 245 246 247 248 249 250 251 252 305 351 255))) -(define-external-format :cp1254 (:mac-roman) +(define-external-format :cp1254 (:base :mac-roman :documentation +"CP1254 is a Windows code page for Turkish. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1254+))) diff --git a/pcl/simple-streams/external-formats/cp1255.lisp b/pcl/simple-streams/external-formats/cp1255.lisp index bf5a03c34e4e2ae88c0847569d85791691d34e77..e257de40ae65d9911d38f21a2d8768c2fc3579ec 100644 --- a/pcl/simple-streams/external-formats/cp1255.lisp +++ b/pcl/simple-streams/external-formats/cp1255.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1255.lisp,v 1.3 2009/06/21 15:12:24 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1255.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -32,5 +32,9 @@ 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 65534 65534 8206 8207 65534))) -(define-external-format :cp1255 (:mac-roman) +(define-external-format :cp1255 (:base :mac-roman :documentation +"CP1255 is a Windows code page for Hebrew. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1255+))) diff --git a/pcl/simple-streams/external-formats/cp1256.lisp b/pcl/simple-streams/external-formats/cp1256.lisp index 72b78d6331f4bf6a2a323e33e7d65f534c5c138c..ff18ea25d3b0895c39de01ff4ed9824b3db25f09 100644 --- a/pcl/simple-streams/external-formats/cp1256.lisp +++ b/pcl/simple-streams/external-formats/cp1256.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1256.lisp,v 1.3 2009/06/21 15:12:25 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1256.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -32,5 +32,9 @@ 247 1617 249 1618 251 252 8206 8207 1746))) -(define-external-format :cp1256 (:mac-roman) +(define-external-format :cp1256 (:base :mac-roman :documentation +"CP1256 is a Windows code page for Arabic. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1256+))) diff --git a/pcl/simple-streams/external-formats/cp1257.lisp b/pcl/simple-streams/external-formats/cp1257.lisp index c09983ebebce8dda2e633faa3f33f6e0fbf166c7..40c5c39433cbbd270dc57094ed571bdf9f61443f 100644 --- a/pcl/simple-streams/external-formats/cp1257.lisp +++ b/pcl/simple-streams/external-formats/cp1257.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1257.lisp,v 1.3 2009/06/21 15:12:25 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1257.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -30,5 +30,9 @@ 311 299 316 353 324 326 243 333 245 246 247 371 322 347 363 252 380 382 729))) -(define-external-format :cp1257 (:mac-roman) +(define-external-format :cp1257 (:base :mac-roman :documentation +"CP1257 is a Windows code page for Estonian, Latvian, and Lithuanian. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1257+))) diff --git a/pcl/simple-streams/external-formats/cp1258.lisp b/pcl/simple-streams/external-formats/cp1258.lisp index fc6404858fadf205b9f46317a7e296fa0dc9945f..26a8d93a345529e3634c30a8ae9fa7c397b5dc53 100644 --- a/pcl/simple-streams/external-formats/cp1258.lisp +++ b/pcl/simple-streams/external-formats/cp1258.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1258.lisp,v 1.3 2009/06/21 15:12:25 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cp1258.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -30,5 +30,9 @@ 237 238 239 273 241 803 243 244 417 246 247 248 249 250 251 252 432 8363 255))) -(define-external-format :cp1258 (:mac-roman) +(define-external-format :cp1258 (:base :mac-roman :documentation +"CP1258 is a Windows code page for Vietnamese. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +ms-cp1258+))) diff --git a/pcl/simple-streams/external-formats/cr.lisp b/pcl/simple-streams/external-formats/cr.lisp index 790d12d098dd3f0a9e91f3c66e0350fbd4b2c63c..4c7796aee23d2c55c6803a95b90232f836e7518e 100644 --- a/pcl/simple-streams/external-formats/cr.lisp +++ b/pcl/simple-streams/external-formats/cr.lisp @@ -4,12 +4,15 @@ ;;; This code was written by Raymond Toy and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cr.lisp,v 1.2 2009/09/09 15:51:28 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/cr.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") ;; Convert CR to/from #\newline. -(define-composing-external-format :cr (:size 1) +(define-composing-external-format :cr (:size 1 :documentation +"CR is a composing external format that converts CR (carriage return) +to a Lisp newline character. This is the Mac end-of-line character +sequence.") (input (state input unput tmp1 tmp2) `(multiple-value-bind (,tmp1 ,tmp2) ,input diff --git a/pcl/simple-streams/external-formats/crlf.lisp b/pcl/simple-streams/external-formats/crlf.lisp index 1d42451279689bdd786e9b5895b56b3a29d6d8e5..ce0c7f3b41dc80c17cdbf11e1f689a03daba75dd 100644 --- a/pcl/simple-streams/external-formats/crlf.lisp +++ b/pcl/simple-streams/external-formats/crlf.lisp @@ -4,12 +4,15 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/crlf.lisp,v 1.3 2009/09/09 15:51:28 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/crlf.lisp,v 1.4 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") ;; Convert DOS cr/lf end-of-line sequence to/from #\newline -(define-composing-external-format :crlf (:max 2) +(define-composing-external-format :crlf (:max 2 :documentation +"CRLF is a composing external format that converts CR/LF (carriage +return/linefeed) to a Lisp newline character. This is the Windoes +end-of-line character sequence.") (input (state input unput tmp1 tmp2 tmp3 tmp4) `(multiple-value-bind (,tmp1 ,tmp2) ,input diff --git a/pcl/simple-streams/external-formats/final-sigma.lisp b/pcl/simple-streams/external-formats/final-sigma.lisp index 244cc9f5777d5c3b6d51b84c691ad06dc6bd1521..de04cbf049c08b6d43fb3278af47f42bc18e9797 100644 --- a/pcl/simple-streams/external-formats/final-sigma.lisp +++ b/pcl/simple-streams/external-formats/final-sigma.lisp @@ -4,12 +4,14 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/final-sigma.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/final-sigma.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") ;; This is a composing format that attempts to detect sigma in ;; word-final position and change it from "σ" (U+03C3) to "ς" (U+03C2). -(define-composing-external-format :final-sigma (:size 1) +(define-composing-external-format :final-sigma (:size 1 :documentation +"FINAL-SIGMA is a composing external format that attempts to detect +sigma in word-final position and changes it from U+03C3 to U+03C2.") (input (state input unput tmp1 tmp2 tmp3 tmp4) `(multiple-value-bind (,tmp1 ,tmp2) ,input (when (= ,tmp1 #x03C3) diff --git a/pcl/simple-streams/external-formats/iso8859-1.lisp b/pcl/simple-streams/external-formats/iso8859-1.lisp index 22070021535468ee1140637d8bf96e267b055fd4..974e3a336ca61dae5bfb453f26475c5f29941e52 100644 --- a/pcl/simple-streams/external-formats/iso8859-1.lisp +++ b/pcl/simple-streams/external-formats/iso8859-1.lisp @@ -4,17 +4,27 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-1.lisp,v 1.4 2010/06/30 04:02:53 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-1.lisp,v 1.5 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") ;; This is actually implemented in the external-formats code ;; It appears here only for reference, and will never get loaded -(define-external-format :iso8859-1 (:size 1) - () +(define-external-format :iso8859-1 (:size 1 :documentation +"ISO8859-1 is an 8-bit character encoding generally intended for +Western European languages including English, German, Italian, +Norwegian, Portuguese, Spanish, Swedish and many others. +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") + () (octets-to-code (state input unput error) - (values ,input 1)) + `(values ,input 1)) (code-to-octets (code state output error) - (,output (if (> ,code 255) #x3F ,code)))) + `(,output (if (> ,code 255) + (if ,error + (funcall ,error "Cannot output codepoint #x~X to ISO8859-1 stream" + ,code 1) + #x3F) + ,code)))) diff --git a/pcl/simple-streams/external-formats/iso8859-10.lisp b/pcl/simple-streams/external-formats/iso8859-10.lisp index 547a8950c2f91d3fb0327c1d9d1a34c8623db571..1980229052e216b6f81dbbe89c7d5b8980d832fe 100644 --- a/pcl/simple-streams/external-formats/iso8859-10.lisp +++ b/pcl/simple-streams/external-formats/iso8859-10.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-10.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-10.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,10 @@ 238 239 240 326 333 243 244 245 246 361 248 371 250 251 252 253 254 312))) -(define-external-format :iso8859-10 (:iso8859-2) +(define-external-format :iso8859-10 (:base :iso8859-2 :documentation +"ISO8859-10 is an 8-bit character encoding intended to cover Nordic +languages. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-10+))) diff --git a/pcl/simple-streams/external-formats/iso8859-13.lisp b/pcl/simple-streams/external-formats/iso8859-13.lisp index bc3b456608e6b370b88ef3208fc5f4aa4b24682f..8d5f58b56483dd59bbde63182af1aa4507467e30 100644 --- a/pcl/simple-streams/external-formats/iso8859-13.lisp +++ b/pcl/simple-streams/external-formats/iso8859-13.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-13.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-13.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,9 @@ 299 316 353 324 326 243 333 245 246 247 371 322 347 363 252 380 382 8217))) -(define-external-format :iso8859-13 (:iso8859-2) +(define-external-format :iso8859-13 (:base :iso8859-2 :documentation +"ISO8859-13 is an 8-bit character encoding for the Baltic languages. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-13+))) diff --git a/pcl/simple-streams/external-formats/iso8859-14.lisp b/pcl/simple-streams/external-formats/iso8859-14.lisp index 6a39c01e8a72c19fa42fd016ade81d8818fc0e6a..af0cabb1fb973f891999fce767a40888b57b6dcc 100644 --- a/pcl/simple-streams/external-formats/iso8859-14.lisp +++ b/pcl/simple-streams/external-formats/iso8859-14.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-14.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-14.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,10 @@ 234 235 236 237 238 239 373 241 242 243 244 245 246 7787 248 249 250 251 252 253 375 255))) -(define-external-format :iso8859-14 (:iso8859-2) +(define-external-format :iso8859-14 (:base :iso8859-2 :documentation +"ISO8859-14 is an 8-bit character encoding intended for the Celtic +languages such as Irish, Manx, Scottish Gaelic, Welsh, and Breton. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-14+))) diff --git a/pcl/simple-streams/external-formats/iso8859-15.lisp b/pcl/simple-streams/external-formats/iso8859-15.lisp index b5fe19caa9b9d8dcc9e0e1b87a59694678cc72bc..63f916628a89c507b5718eb351dac5115de28844 100644 --- a/pcl/simple-streams/external-formats/iso8859-15.lisp +++ b/pcl/simple-streams/external-formats/iso8859-15.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-15.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-15.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,11 @@ 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255))) -(define-external-format :iso8859-15 (:iso8859-2) +(define-external-format :iso8859-15 (:base :iso8859-2 :documentation +"ISO8859-15 is an 8-bit character encoding similar to ISO8859-1 but +replaces some less common symbols with others, including adding the +Euro sign. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-15+))) diff --git a/pcl/simple-streams/external-formats/iso8859-2.lisp b/pcl/simple-streams/external-formats/iso8859-2.lisp index a64b21803dcedffe2b64687aaf0a71a3a64ba9eb..db550c3e433f0d0ab7ceb2ca1a14ad4b8606ff16 100644 --- a/pcl/simple-streams/external-formats/iso8859-2.lisp +++ b/pcl/simple-streams/external-formats/iso8859-2.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-2.lisp,v 1.5 2010/07/07 21:59:49 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-2.lisp,v 1.6 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,7 +19,14 @@ 238 271 273 324 328 243 244 337 246 247 345 367 250 369 252 253 355 729))) -(define-external-format :iso8859-2 (:size 1) +(define-external-format :iso8859-2 (:size 1 :documentation +"ISO8859-2 is an 8-bit character encoding generally intended for +Eastern European languages including Bosnian, Croation, Czech, German, +Hungarian, Polish, Romanian, Serbian Latin, Slovak, Slovene, Upper +Sorbian, and Lower Sorbian. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-2+ :type (simple-array (unsigned-byte 16) (96))) (itable (invert-table table) :type lisp::ntrie16)) diff --git a/pcl/simple-streams/external-formats/iso8859-3.lisp b/pcl/simple-streams/external-formats/iso8859-3.lisp index a32c47eefe2cf39593bcd726b675d29ffe4dc1ea..2a85ed0579a42b6c7a55bdb92e896b00de82235c 100644 --- a/pcl/simple-streams/external-formats/iso8859-3.lisp +++ b/pcl/simple-streams/external-formats/iso8859-3.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-3.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-3.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,11 @@ 237 238 239 65534 241 242 243 244 289 246 247 285 249 250 251 252 365 349 729))) -(define-external-format :iso8859-3 (:iso8859-2) +(define-external-format :iso8859-3 (:base :iso8859-2 :documentation +"ISO8859-3 is an 8-bit character encoding intended for South European +languages including Turkish, Maltese, and Esperanto. For Turkish, +ISO8859-9 supersedes ISO8859-3. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-3+))) diff --git a/pcl/simple-streams/external-formats/iso8859-4.lisp b/pcl/simple-streams/external-formats/iso8859-4.lisp index 07238300448f76570940c3e84d56960d1cd7ce1a..d58d83b62ad6c9ce8426f544d94f91cc70fe55ac 100644 --- a/pcl/simple-streams/external-formats/iso8859-4.lisp +++ b/pcl/simple-streams/external-formats/iso8859-4.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-4.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-4.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,10 @@ 238 299 273 326 333 311 244 245 246 247 248 371 250 251 252 361 363 729))) -(define-external-format :iso8859-4 (:iso8859-2) +(define-external-format :iso8859-4 (:base :iso8859-2 :documentation +"ISO8859-4 is an 8-bit character encoding for North European languages +including Estonian, Latvian, Lithuanian, Greenlandic, and Sami. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-4+))) diff --git a/pcl/simple-streams/external-formats/iso8859-5.lisp b/pcl/simple-streams/external-formats/iso8859-5.lisp index be988e0429990b3d6cbe5994606b8d7d628ffb08..226ed5d4f042c1b4b100436702fc02ba0690e5ed 100644 --- a/pcl/simple-streams/external-formats/iso8859-5.lisp +++ b/pcl/simple-streams/external-formats/iso8859-5.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-5.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-5.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -20,5 +20,11 @@ 1101 1102 1103 8470 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 167 1118 1119))) -(define-external-format :iso8859-5 (:iso8859-2) +(define-external-format :iso8859-5 (:base :iso8859-2 :documentation +"ISO8859-5, informallly referred to as Latin/Cyrillic, is an 8-bit +character encoding intended for languages using a Cyrillic alphabet +such as Bulgarian, Belarusian, Russian, Serbian, and Macedonian. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-5+))) diff --git a/pcl/simple-streams/external-formats/iso8859-6.lisp b/pcl/simple-streams/external-formats/iso8859-6.lisp index a693fb4e6515c7f92ef682b45ec8b4d2c1e73f48..2d68399fc611b0e385754e0deeceaeb0294d504d 100644 --- a/pcl/simple-streams/external-formats/iso8859-6.lisp +++ b/pcl/simple-streams/external-formats/iso8859-6.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-6.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-6.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -21,5 +21,10 @@ 1616 1617 1618 65534 65534 65534 65534 65534 65534 65534 65534 65534 65534 65534 65534 65534))) -(define-external-format :iso8859-6 (:iso8859-2) +(define-external-format :iso8859-6 (:base :iso8859-2 :documentation +"ISO8859-6 is an 8-bit character encoding generally intended languages +using the Arabic alphabet. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-6+))) diff --git a/pcl/simple-streams/external-formats/iso8859-7.lisp b/pcl/simple-streams/external-formats/iso8859-7.lisp index 1cf00b749b665a3a929be35101236eaada679c82..d9718e47f7484a62bebc0e37080a8622e55ba679 100644 --- a/pcl/simple-streams/external-formats/iso8859-7.lisp +++ b/pcl/simple-streams/external-formats/iso8859-7.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-7.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-7.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,10 @@ 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 65534))) -(define-external-format :iso8859-7 (:iso8859-2) +(define-external-format :iso8859-7 (:base :iso8859-2 :documentation +"ISO8859-7 is an 8-bit character encoding for the modern Greek +language. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-7+))) diff --git a/pcl/simple-streams/external-formats/iso8859-8.lisp b/pcl/simple-streams/external-formats/iso8859-8.lisp index 63407e0e4b4baa992affe69c89b1be767d5a109d..395c8f99890ab4a7901ebdec5c65727ce63635a5 100644 --- a/pcl/simple-streams/external-formats/iso8859-8.lisp +++ b/pcl/simple-streams/external-formats/iso8859-8.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-8.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-8.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -21,5 +21,9 @@ 1509 1510 1511 1512 1513 1514 65534 65534 8206 8207 65534))) -(define-external-format :iso8859-8 (:iso8859-2) +(define-external-format :iso8859-8 (:base :iso8859-2 :documentation +"ISO8859-8 is an 8-bit character encoding intended for Hebrew. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-8+))) diff --git a/pcl/simple-streams/external-formats/iso8859-9.lisp b/pcl/simple-streams/external-formats/iso8859-9.lisp index 0fd2889df0f99d776fdae7220f2683b0e8ce3a51..7da494dea8328c3f020c3e6625fafc248f78388d 100644 --- a/pcl/simple-streams/external-formats/iso8859-9.lisp +++ b/pcl/simple-streams/external-formats/iso8859-9.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-9.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/iso8859-9.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -19,5 +19,9 @@ 238 239 287 241 242 243 244 245 246 247 248 249 250 251 252 305 351 255))) -(define-external-format :iso8859-9 (:iso8859-2) +(define-external-format :iso8859-9 (:base :iso8859-2 :documentation +"ISO8859-9 is an 8-bit character encoding for the Turkish language. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +iso-8859-9+))) diff --git a/pcl/simple-streams/external-formats/koi8-r.lisp b/pcl/simple-streams/external-formats/koi8-r.lisp index a9f2b199a645c472b0bf463bc0b7b07fd96df097..09fa9503e9c1e80ea371229f4c943aecc9ad0a63 100644 --- a/pcl/simple-streams/external-formats/koi8-r.lisp +++ b/pcl/simple-streams/external-formats/koi8-r.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/koi8-r.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/koi8-r.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -24,5 +24,9 @@ 1053 1054 1055 1071 1056 1057 1058 1059 1046 1042 1068 1067 1047 1064 1069 1065 1063 1066))) -(define-external-format :koi8-r (:mac-roman) +(define-external-format :koi8-r (:base :mac-roman :documentation +"KOI8-R is an 8-bit character encoding designed to cover Russian. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +koi8-r+))) diff --git a/pcl/simple-streams/external-formats/mac-cyrillic.lisp b/pcl/simple-streams/external-formats/mac-cyrillic.lisp index 4add4684a78daf3e4fce725c9ce8c5b529f11da1..91e4cd4f4f6878e242f523dfc532b17350e2ceef 100644 --- a/pcl/simple-streams/external-formats/mac-cyrillic.lisp +++ b/pcl/simple-streams/external-formats/mac-cyrillic.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-cyrillic.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-cyrillic.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -23,5 +23,10 @@ 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 164))) -(define-external-format :mac-cyrillic (:mac-roman) +(define-external-format :mac-cyrillic (:base :mac-roman :documentation +"MAC-CYRILLIC is an 8-bit character encoding for Cyrillic text on +Apple Macintosh computers. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-cyrillic+))) diff --git a/pcl/simple-streams/external-formats/mac-greek.lisp b/pcl/simple-streams/external-formats/mac-greek.lisp index 6c944dc01eae42437a91fe0beab844069e00d983..44d7fe06217ac812a28869b442b9b4c064bb7c25 100644 --- a/pcl/simple-streams/external-formats/mac-greek.lisp +++ b/pcl/simple-streams/external-formats/mac-greek.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-greek.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-greek.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -21,5 +21,10 @@ 947 951 953 958 954 955 956 957 959 960 974 961 963 964 952 969 962 967 965 950 970 971 912 944 65534))) -(define-external-format :mac-greek (:mac-roman) +(define-external-format :mac-greek (:base :mac-roman :documentation +"MAC-GREEK is an 8-bit character encoding for Greek text on Apple +Macintosh computers. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-greek+))) diff --git a/pcl/simple-streams/external-formats/mac-icelandic.lisp b/pcl/simple-streams/external-formats/mac-icelandic.lisp index 3dcef32d80e82dd630886dbb50ae375b2be9340a..89ef6999b9c06b7af4489d373de30cfe19d1435a 100644 --- a/pcl/simple-streams/external-formats/mac-icelandic.lisp +++ b/pcl/simple-streams/external-formats/mac-icelandic.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-icelandic.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-icelandic.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -22,5 +22,10 @@ 65534 210 218 219 217 305 710 732 175 728 729 730 184 733 731 711))) -(define-external-format :mac-icelandic (:mac-roman) +(define-external-format :mac-icelandic (:base :mac-roman :documentation +"MAC-ICELANDIC is an 8-bit character encoding for Icelandic text on +Apple Macintosh computers. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-icelandic+))) diff --git a/pcl/simple-streams/external-formats/mac-latin2.lisp b/pcl/simple-streams/external-formats/mac-latin2.lisp index 6cd13ce8475d02fefedf08aaf9ed07388efc89b2..ece9e08e57d35be8092992bd188bd0dd9eef41ab 100644 --- a/pcl/simple-streams/external-formats/mac-latin2.lisp +++ b/pcl/simple-streams/external-formats/mac-latin2.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-latin2.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-latin2.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -22,5 +22,11 @@ 218 367 368 369 370 371 221 253 311 379 321 380 290 711))) -(define-external-format :mac-latin2 (:mac-roman) +(define-external-format :mac-latin2 (:base :mac-roman :documentation + +"MAC-LATIN2 is an 8-bit character encoding for Central European text +on Apple Macintosh computers. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-latin2+))) diff --git a/pcl/simple-streams/external-formats/mac-roman.lisp b/pcl/simple-streams/external-formats/mac-roman.lisp index 8db4ceca57aa4403fde28bea61139266dc4ee8a3..59519d111538203c0dd21e4144267c6f637a95af 100644 --- a/pcl/simple-streams/external-formats/mac-roman.lisp +++ b/pcl/simple-streams/external-formats/mac-roman.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-roman.lisp,v 1.6 2010/07/07 21:59:49 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-roman.lisp,v 1.7 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -24,7 +24,12 @@ 212 63743 210 218 219 217 305 710 732 175 728 729 730 184 733 731 711))) -(define-external-format :mac-roman (:size 1) +(define-external-format :mac-roman (:size 1 :documentation +"MAC-ROMAN is an 8-bit character encoding for Western European +languages including English. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-roman+ :type (simple-array (unsigned-byte 16) (128))) (itable (invert-table table) :type lisp::ntrie16)) diff --git a/pcl/simple-streams/external-formats/mac-turkish.lisp b/pcl/simple-streams/external-formats/mac-turkish.lisp index 4487cecfcfc62c9e56c1f58d38db8a5f8ea0d17c..a5e73306df912fd670a79aa5b664cfa55706e068 100644 --- a/pcl/simple-streams/external-formats/mac-turkish.lisp +++ b/pcl/simple-streams/external-formats/mac-turkish.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-turkish.lisp,v 1.2 2009/06/11 16:04:02 rtoy Rel $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/mac-turkish.lisp,v 1.3 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -22,5 +22,11 @@ 65534 210 218 219 217 65534 710 732 175 728 729 730 184 733 731 711))) -(define-external-format :mac-turkish (:mac-roman) +(define-external-format :mac-turkish (:base :mac-roman :documentation + +"MAC-TURKISH is an 8-bit character encoding for Turkish text on +Apple Macintosh computers. + +By default, illegal inputs are replaced by the Unicode replacement +character and illegal outputs are replaced by a question mark.") ((table +mac-turkish+))) diff --git a/pcl/simple-streams/external-formats/utf-16-be.lisp b/pcl/simple-streams/external-formats/utf-16-be.lisp index d3cb2e0fca97f443b9a677a38298c21e7fb13b1c..a83f007576fcf606226860d8fd97d0f278a26fd1 100644 --- a/pcl/simple-streams/external-formats/utf-16-be.lisp +++ b/pcl/simple-streams/external-formats/utf-16-be.lisp @@ -4,13 +4,20 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-be.lisp,v 1.8 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-be.lisp,v 1.9 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") ;; UTF-16BE. BOM is not recognized and is never output. -(define-external-format :utf-16-be (:size 2) +(define-external-format :utf-16-be (:size 2 :documentation +"UTF-16-BE is a variable length character encoding for Unicode. For +both input and output, the data is assumed to be in big-endian order. +No byte-order mark is allowed on input, and no byte-order mark is +produced on output. (This is specified by the Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput error c1 c2 code next) diff --git a/pcl/simple-streams/external-formats/utf-16-le.lisp b/pcl/simple-streams/external-formats/utf-16-le.lisp index b9e736db3f87b779bdb39c83d8654ec9e0d8d300..6c74e66d153fa9a4ecef750690b10cf432f57803 100644 --- a/pcl/simple-streams/external-formats/utf-16-le.lisp +++ b/pcl/simple-streams/external-formats/utf-16-le.lisp @@ -4,14 +4,21 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-le.lisp,v 1.8 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16-le.lisp,v 1.9 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") ;; UTF-16LE. BOM is not recognized, and is never output. ;; ;; The state is either NIL or a codepoint. -(define-external-format :utf-16-le (:size 2) +(define-external-format :utf-16-le (:size 2 :documentation +"UTF-16-LE is a variable length character encoding for Unicode. For +both input and output, the data is assumed to be in little-endian +order. No byte-order mark is allowed on input, and no byte-order mark +is produced on output. (This is specified by the Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput error c1 c2 code next) diff --git a/pcl/simple-streams/external-formats/utf-16.lisp b/pcl/simple-streams/external-formats/utf-16.lisp index 221a52608ca42d0abdc52e9c920315b497953187..b541af12520e4ad441f87ce530fd12827bd258a7 100644 --- a/pcl/simple-streams/external-formats/utf-16.lisp +++ b/pcl/simple-streams/external-formats/utf-16.lisp @@ -1,7 +1,7 @@ ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*- ;;; ;;; ********************************************************************** -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.10 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.11 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -22,7 +22,15 @@ ;; ;; When writing, never output a BOM. -(define-external-format :utf-16 (:size 2) +(define-external-format :utf-16 (:size 2 :documentation +"UTF-16 is a variable length character encoding for Unicode. On +input, a byte-order mark is recognized. If no byte-order mark is +given on input, then the encoding is assumed to be big-endian. For +output, the byte-order mark is not written, and the output is +big-endian. (This is specified by the Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput error c1 c2 code wd next st) diff --git a/pcl/simple-streams/external-formats/utf-32-be.lisp b/pcl/simple-streams/external-formats/utf-32-be.lisp index 9fb447f87d1a5b959596d39e4a5f14afb56b4f35..46c53ed89bed4b643358a768de0b8352c6b13eb2 100644 --- a/pcl/simple-streams/external-formats/utf-32-be.lisp +++ b/pcl/simple-streams/external-formats/utf-32-be.lisp @@ -4,11 +4,19 @@ ;;; This code was written by Raymond Toy and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32-be.lisp,v 1.7 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32-be.lisp,v 1.8 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") -(define-external-format :utf-32-be (:size 4) +(define-external-format :utf-32-be (:size 4 :documentation +"UTF-32-BE is a fixed-length character encoding of 4 octets for +Unicode. For both input and output, the data is assumed to be in +big-endian order. No byte-order mark is allowed on input, and no +byte-order mark is produced on output. (This is specified by the +Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput error c c1 c2 c3 c4) diff --git a/pcl/simple-streams/external-formats/utf-32-le.lisp b/pcl/simple-streams/external-formats/utf-32-le.lisp index aab4c92c4209aaf174518121d537a4720d0f3ed9..21c3d93b614bd26b4a9d59edbf521e6745a4c554 100644 --- a/pcl/simple-streams/external-formats/utf-32-le.lisp +++ b/pcl/simple-streams/external-formats/utf-32-le.lisp @@ -4,11 +4,19 @@ ;;; This code was written by Raymond Toy and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32-le.lisp,v 1.7 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32-le.lisp,v 1.8 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") -(define-external-format :utf-32-le (:size 4) +(define-external-format :utf-32-le (:size 4 :documentation +"UTF-32-LE is a fixed-length character encoding of 4 octets for +Unicode. For both input and output, the data is assumed to be in +little-endian order. No byte-order mark is allowed on input, and no +byte-order mark is produced on output. (This is specified by the +Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput error c c1 c2 c3 c4) diff --git a/pcl/simple-streams/external-formats/utf-32.lisp b/pcl/simple-streams/external-formats/utf-32.lisp index 1afc5d5d93a0294be5975d954d1c8e1f0e3065be..0fd041a8821d487271cc9a3a6242cf341dc84ce5 100644 --- a/pcl/simple-streams/external-formats/utf-32.lisp +++ b/pcl/simple-streams/external-formats/utf-32.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Raymond Toy and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32.lisp,v 1.9 2010/07/05 04:12:47 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-32.lisp,v 1.10 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -26,7 +26,15 @@ ;; (evenp state) = big-endian ;; (zerop state) = #xFEFF/#xFFFE is BOM (to be skipped) ;; -(define-external-format :utf-32 (:size 4) +(define-external-format :utf-32 (:size 4 :documentation +"UTF-32 is a fixed-length character encoding of 4 octets for Unicode. +On input, a byte-order mark is recognized. If no byte-order mark is +given on input, then the encoding is assumed to be big-endian. For +output, the byte-order mark is not written, and the output is +big-endian. (This is specified by the Unicode standard.) + +By default, illegal inputs and illegal outputs are replaced by the +Unicode replacement character.") () (octets-to-code (state input unput code error c1 c2 c3 c4 st wd) diff --git a/pcl/simple-streams/external-formats/utf-8.lisp b/pcl/simple-streams/external-formats/utf-8.lisp index 7875d973ff0cabdb785a51f44cafcbdca8eff1c2..0f670cb3f06f51776d8d1d64a8adac57d1821e92 100644 --- a/pcl/simple-streams/external-formats/utf-8.lisp +++ b/pcl/simple-streams/external-formats/utf-8.lisp @@ -4,7 +4,7 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-8.lisp,v 1.12 2010/07/07 13:43:12 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/utf-8.lisp,v 1.13 2010/07/12 13:58:42 rtoy Exp $") (in-package "STREAM") @@ -13,7 +13,11 @@ ;; ;; See Table 3-7, Ch 3.9 in the Unicode book. -(define-external-format :utf-8 (:min 1 :max 4) +(define-external-format :utf-8 (:min 1 :max 4 :documentation +"UTF-8 is a variable-length character encoding for Unicode. By +default, illegal input sequences are replaced by the Unicode +replacement character.") + () (octets-to-code (state input unput error c i j n) `(labels ((utf8 (,c ,i) diff --git a/pcl/simple-streams/external-formats/void.lisp b/pcl/simple-streams/external-formats/void.lisp index 9816fa4294a0f5f5321803958bcc62501bc14fca..9cdc3bbef769652d5a9b44eb57ce291f765ea96d 100644 --- a/pcl/simple-streams/external-formats/void.lisp +++ b/pcl/simple-streams/external-formats/void.lisp @@ -4,12 +4,13 @@ ;;; This code was written by Paul Foley and has been placed in the public ;;; domain. ;;; -(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/void.lisp,v 1.4 2010/06/30 04:02:53 rtoy Exp $") +(ext:file-comment "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/simple-streams/external-formats/void.lisp,v 1.5 2010/07/12 13:58:42 rtoy Exp $") ;; This is actually implemented in the external-formats code ;; It appears here only for reference, and will never get loaded -(define-external-format :void (:size 0) +(define-external-format :void (:size 0 :documentation +"Void external format that signals an error on any input or output.") () (octets-to-code (state input unput error) `(error 'void-external-format))