Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2017
- 718 messages
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by David T. Lewis
On Wed, Mar 15, 2017 at 05:28:37PM +0000, Rein, Patrick wrote:
> Thanks for looking into this :)
>
> @Dave: Can you explain what you would have expected to happen here? I see the point
> that squeaksource could also encode the response as UTF-8. However, currently the
> page is correctly encoded and delivered in iso-8859-1. From the error message I read that Zinc
> is nevertheless trying to decode it as UTF-8 which fails when it encounters a character with
> a code point > 127.
I did not have anything specific in mind, I just wanted to mention it in
case it was relevant to the problem. Based on the follow up discussion, I
do not think that it is relevant.
For what it's worth, the specific issue in the older squeaksource image is
that when someone registers an account with a user name that requires a
WideString rather than a ByteString, it ends up scrambling the squeaksource
user interface. I am fairly sure that this is fixed in newer versions of
Squeak and/or Seaside, so for now it is just an annoyance for the person
who keeps squeaksource.com running. Whenever that person gets sufficiently
annoyed, I'm sure that the image will get updated ;-)
Dave
>
> Bests
> Patrick
> ________________________________________
> From: Pharo-dev <pharo-dev-bounces(a)lists.pharo.org> on behalf of David T. Lewis <lewis(a)mail.msen.com>
> Sent: Wednesday, March 15, 2017 17:42
> To: Pharo Development List
> Subject: Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
>
> squeaksource.com is still running on a quite old image, and I know that it
> has problems with multibyte characters. If you are seeing problems related
> to this, it's not the fault of Zinc.
>
> If you can confirm that this is what is happening, then I guess it is time
> to update that trusty old squeaksource.com image :-)
>
> Dave
>
> > On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
> >>
> >> Hi everyone,
> >>
> >> I have been working on bringing http://squeaksource.com/ical/ up to
> >> speed
> >> for Squeak and wanted to make sure that it also works for Pharo.
> > Therefore,
> >> I have created a travis build job for Squeak and Pharo
> >> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
> > pulls
> >> the source from squeaksource.com.
> >>
> >> Now the issue is that loading the package in Pharo fails with a
> >> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
> >> might be the result of the squeaksource page delivering the page as
> >> iso-8859-1 as it contains special characters. Any ideas on how to get
> >> this
> >> to work? I do not have access to the ical repository description and I
> > would
> >> like to avoid mirroring the whole repository on GitHub.
> >
> >
> > In a fresh 60437 image, in Playground evaluating...
> >
> > Metacello new
> > configuration: 'ICal';
> > repository: 'github://codeZeilen/ical-smalltalk:master/repository';
> > onConflict: [:ex | ex allow];
> > load.
> > ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
> > /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
> > http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
> > access
> > http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> > utf-8 encoding'
> >
> >
> > In a new fresh 60437 Image (i.e. empty package-cache)
> > World menu > Monticello > +Repository > squeaksource.com...
> > MCSqueaksourceRepository
> > location: 'http://squeaksource.com/ical'
> > user: ''
> > password: ''
> > ==> open repository then errors "MCRepositoryError: Could not access
> > http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> > utf-8 encoding"
> >
> >
> > In Chrome, opening http://www.squeaksource.com/ical
> > then clicking <Versions>
> > and the browser's View Page Source,
> > I see...
> > <?xml version="1.0" encoding="iso-8859-1"?>
> >
> > Googling: zinc iso-8859-1
> > finds...
> > http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
> > but "ZnByteEncoder iso88591"
> > errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
> > and inspecting "ZnByteEncoder byteTextConverters keys sorted"
> > confirms this key is missing (@Sven, I'm curious why was this removed? )
> >
> >
> > Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
> > indicates IBM819 is an alias
> > and " ZnByteEncoder newForEncoding: 'ibm819' "
> > works okay
> >
> > So in MCHttpRepository>>#loadAllFileNames
> > changing...
> > queryAt: 'C' put: 'M;O=D' ;
> > get.
> > to...
> > queryAt: 'C' put: 'M;O=D' .
> > ZnDefaultCharacterEncoder
> > value: (ZnByteEncoder newForEncoding: 'ibm819')
> > during: [client get].
> >
> > Then from Monticello opening the previously defined
> > http://squeaksource.com/ical
> > works!!
> >
> >
> > Now I was hoping that reverting #loadAllFileNames
> > and in Playground doing...
> > converters := ZnByteEncoder byteTextConverters.
> > converters at: 'iso-8859-1' put: (converters at: 'ibm819').
> > might alleviate the problem, but no luck.
> >
> >
> > Anyone know a better way to deal with this that hardcoding the encoding
> > into #loadAllFileNames?
> >
> > cheers -ben
> >
>
>
>
March 15, 2017
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by Sven Van Caekenberghe
> On 15 Mar 2017, at 20:52, Rein, Patrick <Patrick.Rein(a)hpi.de> wrote:
>
> Unfortunately, as I am trying to fix a Travis build, I can not change the call to Zinc.
>
> To be clear about this: I also think that squeaksource should serve UTF-8.
> However, at the same time a missing charset in a HTTP response means that the content
> should be decoded as ISO-8859-1 [1]. So in general this does seem to me like an issue in Zinc.
>
> I see that this might be a problem to change though, so I will consider moving the project at one point (or removing that damn umlaut :) ).
>
> Bests
> Patrick
>
> [1] https://tools.ietf.org/html/rfc2616#section-3.7.1
Hmm, OK, I never saw that paragraph, interesting.
Thanks for the pointer, I will put it on my todo list to think about.
> ________________________________________
> From: Pharo-dev <pharo-dev-bounces(a)lists.pharo.org> on behalf of Ben Coman <btc(a)openinworld.com>
> Sent: Wednesday, March 15, 2017 19:16
> To: Pharo Development List
> Subject: Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
>
> On Thu, Mar 16, 2017 at 1:25 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>
>> Hi,
>>
>> This is a recurring issue.
>
>
> It would be cool if some magic(TM) could raise a dialog with an
> explanation and pull-down list to select an encoding - but maybe that
> is too much hand holding.
>
>
>>
>> The problem is that the server serves a resource, in this case text/html, without specifying its encoding.
>
> I just bumped into [1] while browsing around to learn more, but I
> don't know fully how to interpret it.
> What do you make of it saying "An XHTML5 document is served as XML and
> has XML syntax. XML parsers do not recognise the encoding declarations
> in meta elements. They only recognise the XML declaration. Here is an
> example:
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html ....
>
> compared to the page having...
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> cheers -ben
>
> [1] https://www.w3.org/International/questions/qa-html-encoding-declarations
>
>
>>
>> Today, when no encoding is specified, we default to UTF-8. In this case the server silently serves a resource which is ISO-8895-1 encoded.
>>
>> The error is triggered by accessing the following URL:
>>
>> ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself.
>>
>> If you inspect the response object inside the http client, you will see that the content-type is text/html. So Zn parses the incoming text using UTF-8 which fails (Zn encoders are strict by default).
>>
>> Here is how to change the default during a call:
>>
>> ZnDefaultCharacterEncoder
>> value: ZnCharacterEncoder iso88591
>> during: [ ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself ].
>>
>> The solution would be that the server adds the proper charset specification.
>>
>> Consider the default in Pharo:
>>
>> ZnMimeType textHtml => text/html;charset=utf-8
>>
>> The server should serve this resource using the following Content-Type:
>>
>> text/html;charset=iso-8859-1
>>
>> This is the server's responsibility. The page in question is the MC index page, which would normally be dynamically generated. Somewhere the server decides on the encoding. That encoding does not have to change, but it should be properly indicated in the HTTP response headers.
>>
>> HTH,
>>
>> Sven
>>
>>> On 15 Mar 2017, at 17:42, David T. Lewis <lewis(a)mail.msen.com> wrote:
>>>
>>> squeaksource.com is still running on a quite old image, and I know that it
>>> has problems with multibyte characters. If you are seeing problems related
>>> to this, it's not the fault of Zinc.
>>>
>>> If you can confirm that this is what is happening, then I guess it is time
>>> to update that trusty old squeaksource.com image :-)
>>>
>>> Dave
>>>
>>>> On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
>>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I have been working on bringing http://squeaksource.com/ical/ up to
>>>>> speed
>>>>> for Squeak and wanted to make sure that it also works for Pharo.
>>>> Therefore,
>>>>> I have created a travis build job for Squeak and Pharo
>>>>> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
>>>> pulls
>>>>> the source from squeaksource.com.
>>>>>
>>>>> Now the issue is that loading the package in Pharo fails with a
>>>>> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
>>>>> might be the result of the squeaksource page delivering the page as
>>>>> iso-8859-1 as it contains special characters. Any ideas on how to get
>>>>> this
>>>>> to work? I do not have access to the ical repository description and I
>>>> would
>>>>> like to avoid mirroring the whole repository on GitHub.
>>>>
>>>>
>>>> In a fresh 60437 image, in Playground evaluating...
>>>>
>>>> Metacello new
>>>> configuration: 'ICal';
>>>> repository: 'github://codeZeilen/ical-smalltalk:master/repository';
>>>> onConflict: [:ex | ex allow];
>>>> load.
>>>> ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
>>>> /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
>>>> http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
>>>> access
>>>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>>>> utf-8 encoding'
>>>>
>>>>
>>>> In a new fresh 60437 Image (i.e. empty package-cache)
>>>> World menu > Monticello > +Repository > squeaksource.com...
>>>> MCSqueaksourceRepository
>>>> location: 'http://squeaksource.com/ical'
>>>> user: ''
>>>> password: ''
>>>> ==> open repository then errors "MCRepositoryError: Could not access
>>>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>>>> utf-8 encoding"
>>>>
>>>>
>>>> In Chrome, opening http://www.squeaksource.com/ical
>>>> then clicking <Versions>
>>>> and the browser's View Page Source,
>>>> I see...
>>>> <?xml version="1.0" encoding="iso-8859-1"?>
>>>>
>>>> Googling: zinc iso-8859-1
>>>> finds...
>>>> http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
>>>> but "ZnByteEncoder iso88591"
>>>> errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
>>>> and inspecting "ZnByteEncoder byteTextConverters keys sorted"
>>>> confirms this key is missing (@Sven, I'm curious why was this removed? )
>>>>
>>>>
>>>> Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
>>>> indicates IBM819 is an alias
>>>> and " ZnByteEncoder newForEncoding: 'ibm819' "
>>>> works okay
>>>>
>>>> So in MCHttpRepository>>#loadAllFileNames
>>>> changing...
>>>> queryAt: 'C' put: 'M;O=D' ;
>>>> get.
>>>> to...
>>>> queryAt: 'C' put: 'M;O=D' .
>>>> ZnDefaultCharacterEncoder
>>>> value: (ZnByteEncoder newForEncoding: 'ibm819')
>>>> during: [client get].
>>>>
>>>> Then from Monticello opening the previously defined
>>>> http://squeaksource.com/ical
>>>> works!!
>>>>
>>>>
>>>> Now I was hoping that reverting #loadAllFileNames
>>>> and in Playground doing...
>>>> converters := ZnByteEncoder byteTextConverters.
>>>> converters at: 'iso-8859-1' put: (converters at: 'ibm819').
>>>> might alleviate the problem, but no luck.
>>>>
>>>>
>>>> Anyone know a better way to deal with this that hardcoding the encoding
>>>> into #loadAllFileNames?
>>>>
>>>> cheers -ben
>>>>
>>>
>>>
>>>
>>
>>
>
>
March 15, 2017
Extra Contents has been modified
by stepharong
Hi
I'm coding on 60438 and I have a super annoying glitch. When I click on a
method in the method list of a test method I get
systematically a Contents.... validate or cancel.
I do not have the time to carefully check because I need to commit and
stop and tomorrow is totally crazy (even more).
Stef
--
Using Opera's mail client: http://www.opera.com/mail/
March 15, 2017
Re: [Pharo-dev] Capitalized
by stepharong
Ok I got it
you mean
"'snOOpy' capitalized
>>>'Snoopy'"
and not
"'snOOpy' capitalized
>>>'SnOOpy'"
Indeed.
Now captialized comment is clear.
We could do that in Pharo70 alpha.
Now for OS that distinguish S from s we should pay attention.
Stef
On Wed, 15 Mar 2017 11:33:35 +0100, Torsten Bergmann <astares(a)gmx.de>
wrote:
> According to https://en.wikipedia.org/wiki/Capitalization
>
> to "capitalize" is writing a word with its first letter as a capital
> letter (upper-case letter)
> AND THE REMAINING LETTERS IN LOWER CASE writing systems.
>
> So
>
> 'SOMETHING' capitalized
>
> currently returns "SOMETHING" in Pharo but should return "Something"
> according to the definition to end up with lowercase.
> If we fix this I guess we would also align Pharo with other languages,
> like C# for example [1].
>
> Could be easily changed by replacing "copy" with "asLowercase" in
> #capitalized:
>
> capitalized
> "Return a copy with the first letter capitalized"
> | cap |
> self isEmpty ifTrue: [ ^self copy ].
> cap := self asLowercase.
> cap at: 1 put: (cap at: 1) asUppercase.
> ^ cap
>
> Should we fix this? Do not know about any side effects...
>
>
> Note: a) Squeak has the same issue
> b) it fits for #uncapitalized, see [2]
> c) Dont know about ANSI standard or any other ST dialect
>
> Thx
> T.
>
>
> [1]
> https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/Capital…
> [2]
> https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/Uncapit…
>
--
Using Opera's mail client: http://www.opera.com/mail/
March 15, 2017
Re: [Pharo-dev] Capitalized
by stepharong
Hi torsten
I do not get your point. In Pharo 60 we have.
capitalized
"Return a copy with the first letter capitalized"
| cap |
self isEmpty ifTrue: [ ^self copy ].
cap := self copy.
cap at: 1 put: (cap at: 1) asUppercase.
^ cap
"'snoopy' capitalized
>>> 'Snoopy'"
Stef
March 15, 2017
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by Sven Van Caekenberghe
> On 15 Mar 2017, at 18:28, Rein, Patrick <Patrick.Rein(a)hpi.de> wrote:
>
> Thanks for looking into this :)
>
> @Dave: Can you explain what you would have expected to happen here? I see the point
> that squeaksource could also encode the response as UTF-8. However, currently the
> page is correctly encoded and delivered in iso-8859-1.
It is indeed encoded and delivered correctly, but its content-type (text/html) is missing a charset spec (text/html;charset=iso-8859-1). The server assumes that the client knows its default is ISO-8859-1, while the client cannot know or assume that.
There are two solutions: deliver the index file UTF-8 encoded or deliver the index file ISO-8859-1 encoded as it is now, but use the correct mime-type (text/html;charset=iso-8859-1) - both are good.
> From the error message I read that Zinc
> is nevertheless trying to decode it as UTF-8 which fails when it encounters a character with
> a code point > 127.
>
> Bests
> Patrick
> ________________________________________
> From: Pharo-dev <pharo-dev-bounces(a)lists.pharo.org> on behalf of David T. Lewis <lewis(a)mail.msen.com>
> Sent: Wednesday, March 15, 2017 17:42
> To: Pharo Development List
> Subject: Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
>
> squeaksource.com is still running on a quite old image, and I know that it
> has problems with multibyte characters. If you are seeing problems related
> to this, it's not the fault of Zinc.
>
> If you can confirm that this is what is happening, then I guess it is time
> to update that trusty old squeaksource.com image :-)
>
> Dave
>
>> On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
>>>
>>> Hi everyone,
>>>
>>> I have been working on bringing http://squeaksource.com/ical/ up to
>>> speed
>>> for Squeak and wanted to make sure that it also works for Pharo.
>> Therefore,
>>> I have created a travis build job for Squeak and Pharo
>>> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
>> pulls
>>> the source from squeaksource.com.
>>>
>>> Now the issue is that loading the package in Pharo fails with a
>>> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
>>> might be the result of the squeaksource page delivering the page as
>>> iso-8859-1 as it contains special characters. Any ideas on how to get
>>> this
>>> to work? I do not have access to the ical repository description and I
>> would
>>> like to avoid mirroring the whole repository on GitHub.
>>
>>
>> In a fresh 60437 image, in Playground evaluating...
>>
>> Metacello new
>> configuration: 'ICal';
>> repository: 'github://codeZeilen/ical-smalltalk:master/repository';
>> onConflict: [:ex | ex allow];
>> load.
>> ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
>> /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
>> http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
>> access
>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>> utf-8 encoding'
>>
>>
>> In a new fresh 60437 Image (i.e. empty package-cache)
>> World menu > Monticello > +Repository > squeaksource.com...
>> MCSqueaksourceRepository
>> location: 'http://squeaksource.com/ical'
>> user: ''
>> password: ''
>> ==> open repository then errors "MCRepositoryError: Could not access
>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>> utf-8 encoding"
>>
>>
>> In Chrome, opening http://www.squeaksource.com/ical
>> then clicking <Versions>
>> and the browser's View Page Source,
>> I see...
>> <?xml version="1.0" encoding="iso-8859-1"?>
>>
>> Googling: zinc iso-8859-1
>> finds...
>> http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
>> but "ZnByteEncoder iso88591"
>> errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
>> and inspecting "ZnByteEncoder byteTextConverters keys sorted"
>> confirms this key is missing (@Sven, I'm curious why was this removed? )
>>
>>
>> Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
>> indicates IBM819 is an alias
>> and " ZnByteEncoder newForEncoding: 'ibm819' "
>> works okay
>>
>> So in MCHttpRepository>>#loadAllFileNames
>> changing...
>> queryAt: 'C' put: 'M;O=D' ;
>> get.
>> to...
>> queryAt: 'C' put: 'M;O=D' .
>> ZnDefaultCharacterEncoder
>> value: (ZnByteEncoder newForEncoding: 'ibm819')
>> during: [client get].
>>
>> Then from Monticello opening the previously defined
>> http://squeaksource.com/ical
>> works!!
>>
>>
>> Now I was hoping that reverting #loadAllFileNames
>> and in Playground doing...
>> converters := ZnByteEncoder byteTextConverters.
>> converters at: 'iso-8859-1' put: (converters at: 'ibm819').
>> might alleviate the problem, but no luck.
>>
>>
>> Anyone know a better way to deal with this that hardcoding the encoding
>> into #loadAllFileNames?
>>
>> cheers -ben
>>
>
>
>
>
March 15, 2017
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by monty
> Sent: Wednesday, March 15, 2017 at 2:16 PM
> From: "Ben Coman" <btc(a)openinworld.com>
> To: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> Subject: Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
>
> On Thu, Mar 16, 2017 at 1:25 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
> >
> > Hi,
> >
> > This is a recurring issue.
>
>
> It would be cool if some magic(TM) could raise a dialog with an
> explanation and pull-down list to select an encoding - but maybe that
> is too much hand holding.
That's an interesting idea.
>
> >
> > The problem is that the server serves a resource, in this case text/html, without specifying its encoding.
>
> I just bumped into [1] while browsing around to learn more, but I
> don't know fully how to interpret it.
> What do you make of it saying "An XHTML5 document is served as XML and
> has XML syntax. XML parsers do not recognise the encoding declarations
> in meta elements. They only recognise the XML declaration. Here is an
> example:
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html ....
>
> compared to the page having...
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> cheers -ben
That isn't Zinc's responsibility; it just handles HTTP. The HTML or XML parser using it should disable Zinc's automatic decoding based on Content-Type and do its own decoding of the raw response (which can still be done using Zinc's decoders) informed by the content of the response and not just its Content-Type. XMLParser and XMLParserHTML both use Zinc this way.
> [1] https://www.w3.org/International/questions/qa-html-encoding-declarations
>
>
> >
> > Today, when no encoding is specified, we default to UTF-8. In this case the server silently serves a resource which is ISO-8895-1 encoded.
> >
> > The error is triggered by accessing the following URL:
> >
> > ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself.
> >
> > If you inspect the response object inside the http client, you will see that the content-type is text/html. So Zn parses the incoming text using UTF-8 which fails (Zn encoders are strict by default).
> >
> > Here is how to change the default during a call:
> >
> > ZnDefaultCharacterEncoder
> > value: ZnCharacterEncoder iso88591
> > during: [ ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself ].
> >
> > The solution would be that the server adds the proper charset specification.
> >
> > Consider the default in Pharo:
> >
> > ZnMimeType textHtml => text/html;charset=utf-8
> >
> > The server should serve this resource using the following Content-Type:
> >
> > text/html;charset=iso-8859-1
> >
> > This is the server's responsibility. The page in question is the MC index page, which would normally be dynamically generated. Somewhere the server decides on the encoding. That encoding does not have to change, but it should be properly indicated in the HTTP response headers.
> >
> > HTH,
> >
> > Sven
> >
> > > On 15 Mar 2017, at 17:42, David T. Lewis <lewis(a)mail.msen.com> wrote:
> > >
> > > squeaksource.com is still running on a quite old image, and I know that it
> > > has problems with multibyte characters. If you are seeing problems related
> > > to this, it's not the fault of Zinc.
> > >
> > > If you can confirm that this is what is happening, then I guess it is time
> > > to update that trusty old squeaksource.com image :-)
> > >
> > > Dave
> > >
> > >> On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
> > >>>
> > >>> Hi everyone,
> > >>>
> > >>> I have been working on bringing http://squeaksource.com/ical/ up to
> > >>> speed
> > >>> for Squeak and wanted to make sure that it also works for Pharo.
> > >> Therefore,
> > >>> I have created a travis build job for Squeak and Pharo
> > >>> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
> > >> pulls
> > >>> the source from squeaksource.com.
> > >>>
> > >>> Now the issue is that loading the package in Pharo fails with a
> > >>> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
> > >>> might be the result of the squeaksource page delivering the page as
> > >>> iso-8859-1 as it contains special characters. Any ideas on how to get
> > >>> this
> > >>> to work? I do not have access to the ical repository description and I
> > >> would
> > >>> like to avoid mirroring the whole repository on GitHub.
> > >>
> > >>
> > >> In a fresh 60437 image, in Playground evaluating...
> > >>
> > >> Metacello new
> > >> configuration: 'ICal';
> > >> repository: 'github://codeZeilen/ical-smalltalk:master/repository';
> > >> onConflict: [:ex | ex allow];
> > >> load.
> > >> ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
> > >> /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
> > >> http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
> > >> access
> > >> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> > >> utf-8 encoding'
> > >>
> > >>
> > >> In a new fresh 60437 Image (i.e. empty package-cache)
> > >> World menu > Monticello > +Repository > squeaksource.com...
> > >> MCSqueaksourceRepository
> > >> location: 'http://squeaksource.com/ical'
> > >> user: ''
> > >> password: ''
> > >> ==> open repository then errors "MCRepositoryError: Could not access
> > >> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> > >> utf-8 encoding"
> > >>
> > >>
> > >> In Chrome, opening http://www.squeaksource.com/ical
> > >> then clicking <Versions>
> > >> and the browser's View Page Source,
> > >> I see...
> > >> <?xml version="1.0" encoding="iso-8859-1"?>
> > >>
> > >> Googling: zinc iso-8859-1
> > >> finds...
> > >> http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
> > >> but "ZnByteEncoder iso88591"
> > >> errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
> > >> and inspecting "ZnByteEncoder byteTextConverters keys sorted"
> > >> confirms this key is missing (@Sven, I'm curious why was this removed? )
> > >>
> > >>
> > >> Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
> > >> indicates IBM819 is an alias
> > >> and " ZnByteEncoder newForEncoding: 'ibm819' "
> > >> works okay
> > >>
> > >> So in MCHttpRepository>>#loadAllFileNames
> > >> changing...
> > >> queryAt: 'C' put: 'M;O=D' ;
> > >> get.
> > >> to...
> > >> queryAt: 'C' put: 'M;O=D' .
> > >> ZnDefaultCharacterEncoder
> > >> value: (ZnByteEncoder newForEncoding: 'ibm819')
> > >> during: [client get].
> > >>
> > >> Then from Monticello opening the previously defined
> > >> http://squeaksource.com/ical
> > >> works!!
> > >>
> > >>
> > >> Now I was hoping that reverting #loadAllFileNames
> > >> and in Playground doing...
> > >> converters := ZnByteEncoder byteTextConverters.
> > >> converters at: 'iso-8859-1' put: (converters at: 'ibm819').
> > >> might alleviate the problem, but no luck.
> > >>
> > >>
> > >> Anyone know a better way to deal with this that hardcoding the encoding
> > >> into #loadAllFileNames?
> > >>
> > >> cheers -ben
> > >>
> > >
> > >
> > >
> >
> >
>
>
March 15, 2017
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by Rein, Patrick
Unfortunately, as I am trying to fix a Travis build, I can not change the call to Zinc.
To be clear about this: I also think that squeaksource should serve UTF-8.
However, at the same time a missing charset in a HTTP response means that the content
should be decoded as ISO-8859-1 [1]. So in general this does seem to me like an issue in Zinc.
I see that this might be a problem to change though, so I will consider moving the project at one point (or removing that damn umlaut :) ).
Bests
Patrick
[1] https://tools.ietf.org/html/rfc2616#section-3.7.1
________________________________________
From: Pharo-dev <pharo-dev-bounces(a)lists.pharo.org> on behalf of Ben Coman <btc(a)openinworld.com>
Sent: Wednesday, March 15, 2017 19:16
To: Pharo Development List
Subject: Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
On Thu, Mar 16, 2017 at 1:25 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> Hi,
>
> This is a recurring issue.
It would be cool if some magic(TM) could raise a dialog with an
explanation and pull-down list to select an encoding - but maybe that
is too much hand holding.
>
> The problem is that the server serves a resource, in this case text/html, without specifying its encoding.
I just bumped into [1] while browsing around to learn more, but I
don't know fully how to interpret it.
What do you make of it saying "An XHTML5 document is served as XML and
has XML syntax. XML parsers do not recognise the encoding declarations
in meta elements. They only recognise the XML declaration. Here is an
example:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html ....
compared to the page having...
<?xml version="1.0" encoding="iso-8859-1"?>
cheers -ben
[1] https://www.w3.org/International/questions/qa-html-encoding-declarations
>
> Today, when no encoding is specified, we default to UTF-8. In this case the server silently serves a resource which is ISO-8895-1 encoded.
>
> The error is triggered by accessing the following URL:
>
> ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself.
>
> If you inspect the response object inside the http client, you will see that the content-type is text/html. So Zn parses the incoming text using UTF-8 which fails (Zn encoders are strict by default).
>
> Here is how to change the default during a call:
>
> ZnDefaultCharacterEncoder
> value: ZnCharacterEncoder iso88591
> during: [ ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself ].
>
> The solution would be that the server adds the proper charset specification.
>
> Consider the default in Pharo:
>
> ZnMimeType textHtml => text/html;charset=utf-8
>
> The server should serve this resource using the following Content-Type:
>
> text/html;charset=iso-8859-1
>
> This is the server's responsibility. The page in question is the MC index page, which would normally be dynamically generated. Somewhere the server decides on the encoding. That encoding does not have to change, but it should be properly indicated in the HTTP response headers.
>
> HTH,
>
> Sven
>
> > On 15 Mar 2017, at 17:42, David T. Lewis <lewis(a)mail.msen.com> wrote:
> >
> > squeaksource.com is still running on a quite old image, and I know that it
> > has problems with multibyte characters. If you are seeing problems related
> > to this, it's not the fault of Zinc.
> >
> > If you can confirm that this is what is happening, then I guess it is time
> > to update that trusty old squeaksource.com image :-)
> >
> > Dave
> >
> >> On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
> >>>
> >>> Hi everyone,
> >>>
> >>> I have been working on bringing http://squeaksource.com/ical/ up to
> >>> speed
> >>> for Squeak and wanted to make sure that it also works for Pharo.
> >> Therefore,
> >>> I have created a travis build job for Squeak and Pharo
> >>> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
> >> pulls
> >>> the source from squeaksource.com.
> >>>
> >>> Now the issue is that loading the package in Pharo fails with a
> >>> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
> >>> might be the result of the squeaksource page delivering the page as
> >>> iso-8859-1 as it contains special characters. Any ideas on how to get
> >>> this
> >>> to work? I do not have access to the ical repository description and I
> >> would
> >>> like to avoid mirroring the whole repository on GitHub.
> >>
> >>
> >> In a fresh 60437 image, in Playground evaluating...
> >>
> >> Metacello new
> >> configuration: 'ICal';
> >> repository: 'github://codeZeilen/ical-smalltalk:master/repository';
> >> onConflict: [:ex | ex allow];
> >> load.
> >> ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
> >> /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
> >> http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
> >> access
> >> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> >> utf-8 encoding'
> >>
> >>
> >> In a new fresh 60437 Image (i.e. empty package-cache)
> >> World menu > Monticello > +Repository > squeaksource.com...
> >> MCSqueaksourceRepository
> >> location: 'http://squeaksource.com/ical'
> >> user: ''
> >> password: ''
> >> ==> open repository then errors "MCRepositoryError: Could not access
> >> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
> >> utf-8 encoding"
> >>
> >>
> >> In Chrome, opening http://www.squeaksource.com/ical
> >> then clicking <Versions>
> >> and the browser's View Page Source,
> >> I see...
> >> <?xml version="1.0" encoding="iso-8859-1"?>
> >>
> >> Googling: zinc iso-8859-1
> >> finds...
> >> http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
> >> but "ZnByteEncoder iso88591"
> >> errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
> >> and inspecting "ZnByteEncoder byteTextConverters keys sorted"
> >> confirms this key is missing (@Sven, I'm curious why was this removed? )
> >>
> >>
> >> Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
> >> indicates IBM819 is an alias
> >> and " ZnByteEncoder newForEncoding: 'ibm819' "
> >> works okay
> >>
> >> So in MCHttpRepository>>#loadAllFileNames
> >> changing...
> >> queryAt: 'C' put: 'M;O=D' ;
> >> get.
> >> to...
> >> queryAt: 'C' put: 'M;O=D' .
> >> ZnDefaultCharacterEncoder
> >> value: (ZnByteEncoder newForEncoding: 'ibm819')
> >> during: [client get].
> >>
> >> Then from Monticello opening the previously defined
> >> http://squeaksource.com/ical
> >> works!!
> >>
> >>
> >> Now I was hoping that reverting #loadAllFileNames
> >> and in Playground doing...
> >> converters := ZnByteEncoder byteTextConverters.
> >> converters at: 'iso-8859-1' put: (converters at: 'ibm819').
> >> might alleviate the problem, but no luck.
> >>
> >>
> >> Anyone know a better way to deal with this that hardcoding the encoding
> >> into #loadAllFileNames?
> >>
> >> cheers -ben
> >>
> >
> >
> >
>
>
March 15, 2017
Re: [Pharo-dev] ZnInvalidUTF8 on response from squeaksource
by Sven Van Caekenberghe
> On 15 Mar 2017, at 19:16, Ben Coman <btc(a)openinworld.com> wrote:
>
> On Thu, Mar 16, 2017 at 1:25 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>>
>> Hi,
>>
>> This is a recurring issue.
>
>
> It would be cool if some magic(TM) could raise a dialog with an
> explanation and pull-down list to select an encoding - but maybe that
> is too much hand holding.
>
>
>>
>> The problem is that the server serves a resource, in this case text/html, without specifying its encoding.
>
> I just bumped into [1] while browsing around to learn more, but I
> don't know fully how to interpret it.
> What do you make of it saying "An XHTML5 document is served as XML and
> has XML syntax. XML parsers do not recognise the encoding declarations
> in meta elements. They only recognise the XML declaration. Here is an
> example:
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE html ....
>
> compared to the page having...
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> cheers -ben
>
> [1] https://www.w3.org/International/questions/qa-html-encoding-declarations
I knew you would be going in this direction, but there is a difference in levels.
HTTP is a protocol that does not concern itself with the contents of the resources (documents) it transports. HTTP headers are used as meta data describing the otherwise opaque content. If the headers are wrong, there is not much that can be done.
I believe our XML framework does this interpretation (changing encoding while parsing) correctly, but that is another level (not the transport but the contents itself, it *knows* about XML).
>> Today, when no encoding is specified, we default to UTF-8. In this case the server silently serves a resource which is ISO-8895-1 encoded.
>>
>> The error is triggered by accessing the following URL:
>>
>> ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself.
>>
>> If you inspect the response object inside the http client, you will see that the content-type is text/html. So Zn parses the incoming text using UTF-8 which fails (Zn encoders are strict by default).
>>
>> Here is how to change the default during a call:
>>
>> ZnDefaultCharacterEncoder
>> value: ZnCharacterEncoder iso88591
>> during: [ ZnClient new get: 'http://squeaksource.com/ical/?C=M;O%3DD'; yourself ].
>>
>> The solution would be that the server adds the proper charset specification.
>>
>> Consider the default in Pharo:
>>
>> ZnMimeType textHtml => text/html;charset=utf-8
>>
>> The server should serve this resource using the following Content-Type:
>>
>> text/html;charset=iso-8859-1
>>
>> This is the server's responsibility. The page in question is the MC index page, which would normally be dynamically generated. Somewhere the server decides on the encoding. That encoding does not have to change, but it should be properly indicated in the HTTP response headers.
>>
>> HTH,
>>
>> Sven
>>
>>> On 15 Mar 2017, at 17:42, David T. Lewis <lewis(a)mail.msen.com> wrote:
>>>
>>> squeaksource.com is still running on a quite old image, and I know that it
>>> has problems with multibyte characters. If you are seeing problems related
>>> to this, it's not the fault of Zinc.
>>>
>>> If you can confirm that this is what is happening, then I guess it is time
>>> to update that trusty old squeaksource.com image :-)
>>>
>>> Dave
>>>
>>>> On Wed, Mar 15, 2017 at 8:19 PM, Patrick R. <patrick.rein(a)hpi.de> wrote:
>>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I have been working on bringing http://squeaksource.com/ical/ up to
>>>>> speed
>>>>> for Squeak and wanted to make sure that it also works for Pharo.
>>>> Therefore,
>>>>> I have created a travis build job for Squeak and Pharo
>>>>> (https://travis-ci.org/codeZeilen/ical-smalltalk/jobs/211298950) which
>>>> pulls
>>>>> the source from squeaksource.com.
>>>>>
>>>>> Now the issue is that loading the package in Pharo fails with a
>>>>> GoferException wrapping a ZnInvalidUTF8 Exception. We figured that this
>>>>> might be the result of the squeaksource page delivering the page as
>>>>> iso-8859-1 as it contains special characters. Any ideas on how to get
>>>>> this
>>>>> to work? I do not have access to the ical repository description and I
>>>> would
>>>>> like to avoid mirroring the whole repository on GitHub.
>>>>
>>>>
>>>> In a fresh 60437 image, in Playground evaluating...
>>>>
>>>> Metacello new
>>>> configuration: 'ICal';
>>>> repository: 'github://codeZeilen/ical-smalltalk:master/repository';
>>>> onConflict: [:ex | ex allow];
>>>> load.
>>>> ==> Could not resolve: ICal-Core [ICal-Core-PaulDeBruicker.5] in
>>>> /home/ben/.local/share/Pharo/images/60437-01/pharo-local/package-cache
>>>> http://squeaksource.com/ical ERROR: 'GoferRepositoryError: Could not
>>>> access
>>>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>>>> utf-8 encoding'
>>>>
>>>>
>>>> In a new fresh 60437 Image (i.e. empty package-cache)
>>>> World menu > Monticello > +Repository > squeaksource.com...
>>>> MCSqueaksourceRepository
>>>> location: 'http://squeaksource.com/ical'
>>>> user: ''
>>>> password: ''
>>>> ==> open repository then errors "MCRepositoryError: Could not access
>>>> http://squeaksource.com/ical: ZnInvalidUTF8: Illegal continuation byte for
>>>> utf-8 encoding"
>>>>
>>>>
>>>> In Chrome, opening http://www.squeaksource.com/ical
>>>> then clicking <Versions>
>>>> and the browser's View Page Source,
>>>> I see...
>>>> <?xml version="1.0" encoding="iso-8859-1"?>
>>>>
>>>> Googling: zinc iso-8859-1
>>>> finds...
>>>> http://forum.world.st/Problem-using-Zinc-in-Pharo-4-Moose-5-1-td4825329.html
>>>> but "ZnByteEncoder iso88591"
>>>> errors with "KeyNotFound: key 'iso88591' not found in Dictionary"
>>>> and inspecting "ZnByteEncoder byteTextConverters keys sorted"
>>>> confirms this key is missing (@Sven, I'm curious why was this removed? )
>>>>
>>>>
>>>> Now https://en.wikipedia.org/wiki/ISO/IEC_8859-1
>>>> indicates IBM819 is an alias
>>>> and " ZnByteEncoder newForEncoding: 'ibm819' "
>>>> works okay
>>>>
>>>> So in MCHttpRepository>>#loadAllFileNames
>>>> changing...
>>>> queryAt: 'C' put: 'M;O=D' ;
>>>> get.
>>>> to...
>>>> queryAt: 'C' put: 'M;O=D' .
>>>> ZnDefaultCharacterEncoder
>>>> value: (ZnByteEncoder newForEncoding: 'ibm819')
>>>> during: [client get].
>>>>
>>>> Then from Monticello opening the previously defined
>>>> http://squeaksource.com/ical
>>>> works!!
>>>>
>>>>
>>>> Now I was hoping that reverting #loadAllFileNames
>>>> and in Playground doing...
>>>> converters := ZnByteEncoder byteTextConverters.
>>>> converters at: 'iso-8859-1' put: (converters at: 'ibm819').
>>>> might alleviate the problem, but no luck.
>>>>
>>>>
>>>> Anyone know a better way to deal with this that hardcoding the encoding
>>>> into #loadAllFileNames?
>>>>
>>>> cheers -ben
>>>>
>>>
>>>
>>>
>>
>>
>
March 15, 2017
Re: [Pharo-dev] Type Inference tools
by Frank Shearar
Please do also read the pharo-dev archives: type inference is something
that crops up every 6 months or so. There are a whole bunch of techniques
and tools lying around that people have developed.
frank
On 15 March 2017 at 01:35, Peter Uhnak <i.uhnak(a)gmail.com> wrote:
> Moose ( http://www.moosetechnology.org/ ) optionally uses RoelTyper when
> importing Smalltalk code for analysis.
> Lukas will need a good type inferencer as he is currently working on a
> better autocompetion.
>
> Peter
>
> On Tue, Mar 14, 2017 at 03:38:51PM -0700, Gus wrote:
> > Hi,
> > I am working on a project of type inference, and i have the following
> doubt
> > Are there currently any tools in pharo that use this information
> (perhaps in
> > any library)?
> > For example: a better autocomplete where you can chose different types,
> or
> > tool that show you the type of a variable.
> > I've already downloaded Roel Typer but i couldn't find any of those
> tools.
> > Any help would be appreciated.
> > Thanks
> >
> >
> >
> > --
> > View this message in context: http://forum.world.st/Type-
> Inference-tools-tp4938677.html
> > Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
> >
>
>
March 15, 2017