Re: [Pharo-users] How to zip a WideString

2019-10-10 Thread Esteban Maringolo
On Wed, Oct 9, 2019 at 3:18 PM Sven Van Caekenberghe wrote: > > Actually, thinking about the original use case, I now feel that it would be > best to remove #zipped/unzipped from String. Please do. Cases like this teach us about the proper separation of concerns. Regards, -- Esteban

Re: [Pharo-users] How to zip a WideString

2019-10-10 Thread Sven Van Caekenberghe
> On 4 Oct 2019, at 06:36, Richard O'Keefe wrote: > > There is no need for > a separate #utf8Encoded, that's what asByteArrayDo: *does*." so #asByteArrayDo: produces UTF8 bytes, which is an encoding, so it seems fixed, IIUC. But this is the Pharo mailing list and your are referring to a sys

Re: [Pharo-users] How to zip a WideString

2019-10-10 Thread Richard O'Keefe
examples, I think you will see > >> why the chosen interface was used. > >> > >> Peter Kenny > >> > >> > >> -Original Message- > >> From: Pharo-users On Behalf Of > >> Richard O'Keefe > >> Sent: 03 October 2019 23:08 > >> To: Any question about pharo is welcome > >> Subject: Re: [Pharo-users] How to zip a WideString > >> > >> The interface should surely be > >> SomeClass > >> methods for: 'compression' > >> zipped "return a byte array" > >> > >>class methods for: 'decompression' > >> unzip: aByteArray "return an instance of SomeClass" > >> > >> > > > >

Re: [Pharo-users] How to zip a WideString

2019-10-09 Thread Sven Van Caekenberghe
Actually, thinking about the original use case, I now feel that it would be best to remove #zipped/unzipped from String. The original problem was that 'Les élèves Françaises ont 100 €' zipped unzipped. does not work (it fails on WideStrings), while we now have 'Les élèves Françaises ont 10

Re: [Pharo-users] How to zip a WideString

2019-10-09 Thread Sven Van Caekenberghe
r Kenny >> >> >> -----Original Message- >> From: Pharo-users On Behalf Of Richard >> O'Keefe >> Sent: 03 October 2019 23:08 >> To: Any question about pharo is welcome >> Subject: Re: [Pharo-users] How to zip a WideString >> >> The interface should surely be >> SomeClass >> methods for: 'compression' >> zipped "return a byte array" >> >>class methods for: 'decompression' >> unzip: aByteArray "return an instance of SomeClass" >> >> >

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Richard O'Keefe
ss in your examples, I think you will see why the chosen interface was > used. > > Peter Kenny > > > -Original Message- > From: Pharo-users On Behalf Of Richard > O'Keefe > Sent: 03 October 2019 23:08 > To: Any question about pharo is welcome > Subjec

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
hosen interface was used. Peter Kenny -Original Message- From: Pharo-users On Behalf Of Richard O'Keefe Sent: 03 October 2019 23:08 To: Any question about pharo is welcome Subject: Re: [Pharo-users] How to zip a WideString The interface should surely be SomeClass m

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Richard O'Keefe
The interface should surely be SomeClass methods for: 'compression' zipped "return a byte array" class methods for: 'decompression' unzip: aByteArray "return an instance of SomeClass"

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
> On 3 Oct 2019, at 18:25, Sean P. DeNigris wrote: > > Peter Kenny wrote >> Just 5 hours from when I raised the question, there is a solution in place >> for everyone. This group is amazing! > > Indeed. Bravo, Sven and all of our other contributors. Thanks, but I must say that it was Tomo's

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sean P. DeNigris
Peter Kenny wrote > Just 5 hours from when I raised the question, there is a solution in place > for everyone. This group is amazing! Indeed. Bravo, Sven and all of our other contributors. I can't resist mentioning that the fix would almost certainly have taken significantly longer a few years a

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
t;> Peter Kenny >> >> -Original Message- >> From: Pharo-users On Behalf Of >> Tomohiro Oda >> Sent: 03 October 2019 12:22 >> To: Any question about pharo is welcome >> Subject: Re: [Pharo-users] How to zip a WideString >> >> Sven, >

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
t; -Original Message- >> From: Pharo-users On Behalf Of >> Tomohiro Oda >> Sent: 03 October 2019 12:22 >> To: Any question about pharo is welcome >> Subject: Re: [Pharo-users] How to zip a WideString >> >> Sven, >> >> Yes, ByteArr

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
n I was hoping for. Any > chance this might make it into standard Pharo (perhaps inP8)? > > Peter Kenny > > -Original Message- > From: Pharo-users On Behalf Of Tomohiro > Oda > Sent: 03 October 2019 12:22 > To: Any question about pharo is welcome > Subject

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
s On Behalf Of Tomohiro Oda Sent: 03 October 2019 12:22 To: Any question about pharo is welcome Subject: Re: [Pharo-users] How to zip a WideString Sven, Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of zipping/unzipping binary data. I also love the new idioms. They loo

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Tomohiro Oda
Sven, Yes, ByteArray>>zipped/unzipped are simple, neat and intuitive way of zipping/unzipping binary data. I also love the new idioms. They look clean and concise. Best Regards, --- tomo 2019年10月3日(木) 20:14 Sven Van Caekenberghe : > > Actually, thinking about this a bit more, why not add #zipped

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Actually, thinking about this a bit more, why not add #zipped #unzipped to ByteArray ? ByteArray>>#zipped "Return a GZIP compressed version of the receiver as a ByteArray" ^ ByteArray streamContents: [ :out | (GZipWriteStream on: out) nextPutAll: self; close ] ByteArray>>#unzipped

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Hi Tomo, Indeed, I stand corrected, it does indeed seem possible to use the existing gzip classes to work from bytes to bytes, this works fine: data := ByteArray streamContents: [ :out | (GZipWriteStream on: out) nextPutAll: 'foo 10 €' utf8Encoded; close ]. (GZipReadStream on: data) upToEnd ut

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
n Caekenberghe Sent: 03 October 2019 10:56 To: Any question about pharo is welcome Subject: Re: [Pharo-users] How to zip a WideString Hi Peter, About #zipped / #unzipped and the inflate / deflate classes: your observation is correct, these work from string to string, while clearly the compressed

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Tomohiro Oda
Peter and Sven, zip API from string to string works fine except that aWideString zipped generates malformed zip string. I think it might be a good guidance to define String>>zippedWithEncoding: and ByteArray>>unzippedWithEncoding: . Such as String>>zippedWithEncoding: encoder zippedWithEncoding: e

Re: [Pharo-users] How to zip a WideString

2019-10-03 Thread Sven Van Caekenberghe
Hi Peter, About #zipped / #unzipped and the inflate / deflate classes: your observation is correct, these work from string to string, while clearly the compressed representation should be binary. The contents (input, what is inside the compressed data) can be anything, it is not necessarily a

[Pharo-users] How to zip a WideString

2019-10-03 Thread PBKResearch
Hello I have a problem with text storage, to which I seem to have found a solution, but it's a bit clumsy-looking. I would be grateful for confirmation that (a) there is no neater solution, (b) I can rely on this to work - I only know that it works in a few test cases. I need to store a lar