New Streams & Converters

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

New Streams & Converters

Sean P. DeNigris
Administrator
How would I do the following with the new streams (was working in 6.1, now
"Instance of ZnCharacterReadStream did not understand #converter:"):
aFileRef readStreamDo: [ :str |
        str
                converter: ISO88592TextConverter new;
                upToEnd ].



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: New Streams & Converters

Sven Van Caekenberghe-2
Given a binary stream, you wrap it to decode it:

 (ZnCharacterReadStream on: binaryStream encoding: #iso88592) upToEnd.

There is also #readStreamEncoded:do: directly on FileReference.

> On 1 Sep 2019, at 06:04, Sean P. DeNigris <[hidden email]> wrote:
>
> How would I do the following with the new streams (was working in 6.1, now
> "Instance of ZnCharacterReadStream did not understand #converter:"):
> aFileRef readStreamDo: [ :str |
> str
> converter: ISO88592TextConverter new;
> upToEnd ].
>
>
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>