Hi Bernhard Have a look at how guille started to implement File package. (Guille is actively converting all the image users of the old hierarchy but last time he losts a couple of hours because changing epicea and other users of positionable streams and sourceArray... at the same time was leading to complex situations :). But Guille told me that he learned and will come back to this.) He is using ZnCharacterWriteStream and wrapper like ZnCrPortableWriteStream. writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag | extension fileName outputStream | extension := stOrCsFlag ifTrue: ['.st'] ifFalse: ['.cs']. fileName := baseName, extension. fileName := FileSystem disk checkName: fileName fixErrors: true. outputStream := (File named: fileName) writeStream. (ZnCrPortableWriteStream on: (ZnCharacterWriteStream on: outputStream encoding: 'utf8')) nextPutAll: aStream contents. outputStream close. writeSourceCodeFrom: aStream toFileReference: aFileReference aFileReference writeStreamDo: [ :outputStream | (ZnCrPortableWriteStream on: (ZnCharacterWriteStream on: outputStream encoding: 'utf8')) nextPutAll: aStream contents. ]. self inform: 'Filed out to: ', String cr, aFileReference basename self inform: 'Filed out to: ', String cr, fileName. I hope it helps. Stef On Sat, Dec 30, 2017 at 1:27 PM, Bernhard Pieber <bernhard@pieber.com> wrote:
I just saw that the FileStream hierarchy including MultiByteFileStream is deprecated. However, I can't find what file stream class should be used to read a UTF-8 encoded file instead. FileReference>>#readStreamDo: also uses MultiByteFileStream.
Can someone please point me to the right code?
Bernhard