Norbert, On 05 Dec 2011, at 18:07, Norbert Hartl wrote:
As Zinc is now part of pharo may I assume that bug reports belong to the pharo tracker?
Yes, please use the Pharo-Dev list.
I've discovered a problem in Zinc. If you execute this piece of code
| client entity | client := ZnNeoClient new. entity := client applicationFormUrlEncodedEntity. entity at: 'testkey' put: 'ö'. Transcript show: 'entity type: ', entity contentType printString; cr. Transcript show: 'encoded body: ', (String streamContents: [:stream| entity writeRepresentationOn: stream ])
You'll get (in pharo #13315)
entity type: application/x-www-form-urlencoded;charset=iso-8859-1 encoded body: testkey=%C3%B6
As you can see the content type contains latin-1 as encoding while the body is utf-8 encoded. The utf-8 encoding comes from
ZnUtils class>>writeQueryFields:on:
that uses encodeForHTTP which uses utf-8 by default.
Norbert
Hmm, In my image, there is no charset attribute for that mime type, did you add it yourself ? ZnApplicationFormUrlEncodedEntity new contentType printString gives 'application/x-www-form-urlencoded' On the other hand you are right: ZnUtils class>>writeQueryFields:on: does indeed always use the UTF8 based #encodeForHTTP of which there is also an encoding based variant that would be more correct I guess. I assume this is not a theoretical exercise and that you have actual code failing because of this ? Please file a bug report. You could also suggest a fix based on the lastet version if you feel like it. Or at least some unit test. If not, I will try to fix it, time permitting. Thanks for reporting this. Sven PS: ZnNeoClient has been renamed ZnClient since more than a month, you probably best use the latest version.