Clojure

clojure.xml/emit should be encoding-aware

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None

Description

clojure.xml/emit blithely asserts that it's writing UTF-8 despite the fact that it's actually writing characters, not bytes. Encoding isn't actually decided until actual bytes are written. This forces clients using clojure.xml/emit to write XML back to disk to use UTF-8. They won't know to do that unless they actually peek at the implementation. This behavior isn't documented.

(defn emit [x]
  (println "<?xml version='1.0' encoding='UTF-8'?>")
  (emit-element x))

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/411
Hide
Assembla Importer added a comment -

stu said: APIs without docstrings (like emit) are not supported.

We would welcome a redesign of the XML support that made this good enough to publicize and support.

Show
Assembla Importer added a comment - stu said: APIs without docstrings (like emit) are not supported. We would welcome a redesign of the XML support that made this good enough to publicize and support.

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: