Decoding bug with XMLParser ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: Decoding bug with XMLParser ?

Alexandre Bergel-4
> 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>&#8230;</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


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
12