sca-c-cpp message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [sca-c-cpp] NEW ISSUE: XML Snippets should not contain encodingdeclaration.
- From: Andrew Borley <BORLEY@uk.ibm.com>
- To: sca-c-cpp@lists.oasis-open.org
- Date: Wed, 22 Jul 2009 10:33:03 +0100
This issue has been assigned id CCPP-88
by the Jira system.
See http://www.osoa.org/jira/browse/CCPP-88
Andrew
____________________________________________________________
Andrew Borley
Websphere ESB Development
Tel: 245393 Ext: +44 (0) 1962 815393 Mob: +44 (0) 7971 805547
E-mail: borley@uk.ibm.com
Mailpoint 211, IBM (UK) Ltd, Hursley Park, Winchester, Hants, SO21 2JN
____________________________________________________________
From:
| Bryan Aupperle <aupperle@us.ibm.com>
|
To:
| sca-c-cpp@lists.oasis-open.org
|
Date:
| 20/07/2009 16:01
|
Subject:
| [sca-c-cpp] NEW ISSUE: XML Snippets
should not contain encoding declaration. |
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
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]