Re: [Pharo-project] TextConverter handling of binary streams
fix fix fix :) Stef
I would even go further, the test UTF8TextConverterTest>>#testPutSingleCharacter is plain wrong, it seems to have been written as an afterthought:
testPutSingleCharacter | actual | actual := ByteArray streamContents: [ :stream | | converter | converter := UTF8TextConverter new. converter nextPut: $a toStream: stream. converter nextPut: (Unicode value: 16r20AC) toStream: stream ]. self assert: actual = #[97 0 0 32 172]
The correct result is #[97 226 130 172] !!
If you would give these bytes to any other system, they would never be able to decode them as UTF-8.
On 30 Nov 2010, at 12:20, Stéphane Ducasse wrote:
fix fix fix :)
I created issue #3360. I already knew that you would be asking for code, so yesterday I wrote an alternative UTF-8 encoder as a support class to Zinc HTTP Components. The problem is that what we are now calling 'wrong' seems to be added 'by design'. The question is why and what will be the impact of changing that behavior ? Sven
participants (2)
-
Stéphane Ducasse -
Sven Van Caekenberghe