First, check GRUtf8CodecStream (this is what I use.... even outside seaside). There, you can see for example how the method #nextPutAll: calls the #_encodeAsUTF8intoString
Another possibility is to do something like this:
| file |
file := GsFile open: aFilename mode: 'w' onClient: false.
file nextPutAll: aString encodeAsUTF8.
file close
Finally, Gemstone 3.4 comes with new primitives and some helper methods to better deal with streaming and UTF8. The classes in question are StringAppendStream and AppendStream. The new primitive is #addAllUtf8:. So you can replace previous writing like this:
aStream nextPutAll: aString encodeAsUTF8
with this:
anAppendStream nextPutAllUtf8: aString
AppendStream is usually "safer" to use as its subclass from Stream. StringAppendStream might be slightly faster, but as it subclass from String, it has a few Stream like methods. So you must be sure what you use from the stream API.
Let me know if it helped.
Cheers,
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass