Hi,
i search to create a new file in smallwiki but i can't.
Can you give me one simple example to try in workspace,please.
I've tried with this,but it doesn't work:
writeFile
| aNewFileStream anEncodedStream |
aNewFileStream := NewFileStream
createFile: 'C:\testutf.txt' mode: #binary
onError: [].
anEncodedStream := EncodedStream on: aNewFileStream
encodedBy: UTF8StreamEncoder new.
anEncodedStream nextPut: (Character unicodeValue: 65279).
anEncodedStream nextPutAll: ( '125,00 ').
anEncodedStream nextPutAll: ( 'test ').
aNewFileStream close.
readFile
| aNewFileStream anEncodedStream aString |
aNewFileStream := NewFileStream
on: (File open: 'c:\testutf.txt') mode: #binary.
anEncodedStream := EncodedStream on: aNewFileStream
encodedBy: UTF8StreamEncoder new.
anEncodedStream next.
"Skip header(BOM; for example, FF FE ..)"
aString := anEncodedStream nextString.
aNewFileStream close.
aString out.
cheers
Gianluca
____________________________________________________________
Navighi a 4 MEGA e i primi 3 mesi sono GRATIS.
Scegli Libero Adsl Flat senza limiti su
http://www.libero.it