[Glass] Problems managing files from Pharo and GemStone

Mariano Martinez Peck marianopeck at gmail.com
Tue Apr 15 12:01:51 PDT 2014


On Tue, Apr 15, 2014 at 1:37 PM, Richard Sargent <
richard.sargent at gemtalksystems.com> wrote:

> Mariano Martinez Peck wrote
> > Ok. It seems that in GemStone GsFile only accepts 0-255 range so I need
> to
> > pre-encode strings. ...
> >
> > is this the way that it should be done in GemStone?
>
> That is correct. GsFile provides no automatic character encoding.
>
>
mmmm I wonder which is the better way to handle the real stream API.. I
mean... if each time I do a #nextPutAll: with a string I need to send
#encodeAsUTF8,
that is not very fun. I wonder if Johan's text converters or
MultiByteBinaryOrTextStream could be used. Ideally we should have a stream
API that allow us to transparently encode with certain encoding, right?

Anyway....is it OK to assume FileStream will be able to properly decode a
UTF stored? Say I wrote a file like this:

myfile := GsFile openWrite: self filename.
myfile nextPutAll: 'myRootObject' sixxString encodeAsUTF8.
myfile close.

(or any other file created by Pharo encoded with UTF8 as well)

(FileStream oldFileNamed: self filename)

will the api of FileStream know how to read this? I ask because I found
methods like #contentsAsUtf8 which made me doubt.

Thanks in advance,


>
>
> --
> View this message in context:
> http://forum.world.st/Glass-Problems-managing-files-from-Pharo-and-GemStone-tp4754791p4754805.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140415/85fe5c9f/attachment.html>


More information about the Glass mailing list