add support for specifying encoding for std xhtml sites
[lml2.git] / base.lisp
index 208e1a7a9b78655815bed49f7cfd6ac03d2e4af1..407429f6a244ef863f8defc5f7f1ed0067874f99 100644 (file)
--- a/base.lisp
+++ b/base.lisp
               ""
               (format nil " encoding=\"~A\"" encoding))))
 
-(defun dtd-prologue (&optional (format :xhtml11) &key entities)
-  (case format
+(defun dtd-prologue (&optional (format :xhtml11) (encoding :iso-8859-1) &key entities)
+  (ecase format
     ((:xhtml :xhtml11 :xhtml10-strict :xhtml10-transitional :xhtml10-frameset :xml)
-     (lml-write-string +xml-prologue-string+)
+     (lml-write-string +xml-prologue-begin+)
+     (ecase encoding
+       (:iso-8859-1
+        (lml-write-string "iso-8859-1"))
+       (:utf-8
+        (lml-write-string "UTF-8")))
+     (lml-write-string +xml-prologue-end+)
      (lml-write-char #\newline)
      (case format
        ((:xhtml11 :xhtml)