sca-c-cpp message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: NEW ISSUE: XML Snippets should not contain encoding declaration.
- From: Bryan Aupperle <aupperle@us.ibm.com>
- To: sca-c-cpp@lists.oasis-open.org
- Date: Mon, 20 Jul 2009 11:00:48 -0400
Target: C++ C&I spec and
C C&I spec CD03 Rev 2 of both
Description:
Here is a excerpt of an exchanged
that took place in the Bindings TC. The points being made are applicable
to our specs as well.
But of more important, as a general rule, I don't
think we should include encoding in inlined text examples in any of our
specs. It doesn't make a lot of sense.
XML files without encoding attribute on the XML declaration is valid and
usually not necessary especially when BOM takes care of it.
I agree, we could have just removed the entire line and
it wouldn't harm the example. The fact that it was an example may lead
someone to copy/paste it and then later get surprised by the encoding as
they modify it. If the line is there, I think it's a better practice to
make it portable.
I agree that encoding="ASCII" in our examples
is a bad idea. But it should not be assumed that sticking UTF-8 necessarily
solves all the problems of cut-paste-edit. The editor used may not recognize
the XML encoding attribute (or is it pseudo-attribute?) and may save it
in a non-UTF8 format. This (UTF-16) is actually not uncommon for say Japanese
characters, where UTF-16 is preferred as it results in a smaller disk size
for the file. If portability is a concern *and* if the XML decl is to be
retained, we should not include the encoding pseudo-attribute at all. The
assumption here being that in the cut-paste-edit scenario the editor would
do the Right Thing wrt byte-order marks. I think this is a safer assumption.
Note the suggestion in the second
paragraph.
Proposal:
Remove lines of the form: <?xml
version="1.0" encoding="..."?>
from all snippets
Bryan Aupperle, Ph.D.
STSM, WebSphere Enterprise Platform Software Solution Architect
Research Triangle Park, NC
+1 919-254-7508 (T/L 444-7508)
Internet Address: aupperle@us.ibm.com
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]