Comment #1 on issue 3360 by sven.van.caekenberghe: TextConverter handling
of binary streams is wrong
http://code.google.com/p/pharo/issues/detail?id=3360
ZnUTF8Encoder seems about 20% faster than UTF8Converter based on the
following benchmark (which adds too many characters with multibyte
encodings I guess):
[ 100 timesRepeat: [ZnCharacterEncoderTests new testUTF8EncoderAuto] ]
timeToRun.
[ 100 timesRepeat:
[ | in tmp out |
in := String withAll: ((1 to: 3072) collect: [ :each | Character value:
each ]).
tmp := in convertToWithConverter: UTF8TextConverter new.
out := tmp convertFromWithConverter: UTF8TextConverter new.
self assert: in = out ] ] timeToRun.
Note that tmp is a ByteString not a ByteArray..
Sven