| Subject: | [Issue 8] Char x0000 as String? | |
|---|---|---|
| From: | kgoodson (kgoo...@dev.java.net) | |
| Date: | Feb 7, 2008 2:47:36 am | |
| List: | net.java.dev.jsr235.issues | |
https://jsr235.dev.java.net/issues/show_bug.cgi?id=8
------- Additional comments from kgoo...@dev.java.net Thu Feb 7 10:47:58 +0000
2008 -------
Comment by Radu Preotiuc [ 20/Dec/07 06:49 PM ]
Stefan is right, 0x0 is a valid Unicode character, but XML (even version 1.1) does not allow it, citing "potential problems with APIs". On the other hand, XML 1.1 allows any other Unicode character. So using some above-XML level escape just for this one character seems the wrong thing to do.
What would make sense to me is change the conversion rules from Character to String, to map Character 0x0 to String "' (empty string). We are still left with the problem of Strings containing the 0x0 character, but at that point I feel it would be OK to say "not supported by SDO". Comment by Stefan Bünnig [ 21/Dec/07 08:55 AM ]
Here are the valid xml characters: http://www.w3.org/TR/2000/WD-xml-2e-20000814#dt-character
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
I agree to Radu that illegal characters in Strings shouldn't be supported in
SDO.
If we keep 0x0 as the default value for characters, the representation as ""
(empty string) is also my best idea.
I think the best solution is to find a new default value for characters, e.g.
'0' (#x30) or ' ' (space, #x20), but I'm afraid, the most of you think it's to
late for that change. I know, it would be a breaking change but I'm sure that if
no one has noticed the serialization problem then no one would notice that
change.





