[Pharo-project] Fwd: Re: Decoding bug with XMLParser ?

Alexandre Bergel alexandre.bergel at inria.fr
Fri May 21 10:23:34 EDT 2010


> While in Pharo it's:
> (Unicode value: 8230) codePoint. "===> 1069555750"
> (Character value: 1069555750) charCode. "===> 8230"
> (Character value: 1069555750) leadingChar. "===> 255"

Thanks for you all for your explanation.

Therefore, the following test goes green:
-=-=-=-=-=-=-=-=-=
exampleEncodedXML
	^'<?xml version="1.0" encoding="UTF-8"?>
<test-data>…</test-data>
'

testDecodingCharacters
	| xmlDocument element |

	xmlDocument := XMLDOMParser parseDocumentFrom: self exampleEncodedXML readStream.
	element := xmlDocument firstTagNamed: #'test-data'.

	self assert: element contentString first charCode = 8230.	
	self assert: element contentString first leadingChar = 255.	
	self assert: element contentString first codePoint = 1069555750
-=-=-=-=-=-=-=-=-=

What we first thought as a bug, is plain expected behavior.

Fixed in XML-Parser-Alexandre_Bergel.76

Cheers,
Alexandre





More information about the Pharo-dev mailing list