#BUGFIX by stefan
class: CharacterArray
changed:
#printXmlQuotedOn:
#printXmlTextQuotedOn:
always output ISO8859-1 compatible characters
--- a/CharacterArray.st Mon Dec 03 10:38:22 2018 +0100
+++ b/CharacterArray.st Mon Dec 03 15:02:45 2018 +0100
@@ -6147,6 +6147,8 @@
"convert aString to a valid XML string
that can be used for XML attributes.
Can also be used for XML text, but better use #printXmlTextQuotedOn:.
+ Various senders expect, that the output is ISO-8859-1 compatible
+ (they don't care for encoding), so for now, we always generate 8-bit chars.
TODO: care for 16bit UNICODE string and escape chars ..."
<resource: #todo>
@@ -6165,7 +6167,7 @@
] ifFalse:[
|codePoint|
codePoint := eachChar codePoint.
- (codePoint < 16r20 or:[codePoint >= 16r7F and:[codePoint <= 16r9F]]) ifTrue:[
+ (codePoint < 16r20 or:[codePoint >= 16r7F "and:[codePoint <= 16r9F] for now, always make sure, that output is ISO-8859-1 comparible"]) ifTrue:[
aStream nextPutAll:'&#'.
codePoint printOn:aStream base:16.
aStream nextPut:$;.
@@ -6175,7 +6177,7 @@
]]]]]
].
- "Modified: / 26-11-2018 / 15:01:26 / Stefan Vogel"
+ "Modified (comment): / 03-12-2018 / 15:01:46 / Stefan Vogel"
!
printXmlTextQuotedOn:aStream
@@ -6185,6 +6187,8 @@
Here line formatting characters are not escaped.
For XML text (as opposed to XML attribute), $' and $"" need
not to be transliterated (see https://www.w3.org/TR/xml Section 2.4).
+ Various senders expect, that the output is ISO-8859-1 compatible
+ (they don't care for encoding), so for now, we always generate 8-bit chars.
TODO: care for 16bit UNICODE string and escape chars
- but we need to know the XML file encoding"
@@ -6199,7 +6203,7 @@
|codePoint|
codePoint := eachChar codePoint.
((codePoint < 16r20 and:[codePoint ~~ 9 and:[codePoint ~~ 10 and:[codePoint ~~ 13]]])
- or:[codePoint >= 16r7F and:[codePoint <= 16r9F]]) ifTrue:[
+ or:[codePoint >= 16r7F "and:[codePoint <= 16r9F] for now, always make sure, that output is ISO-8859-1 comparible"]) ifTrue:[
aStream nextPutAll:'&#x'.
codePoint printOn:aStream base:16.
aStream nextPut:$;.
@@ -6217,7 +6221,7 @@
"
"Modified: / 30-08-2018 / 22:39:00 / Claus Gittinger"
- "Modified: / 26-11-2018 / 15:00:32 / Stefan Vogel"
+ "Modified: / 03-12-2018 / 15:00:19 / Stefan Vogel"
!
xmlQuotedPrintString