uft-8 MAFileModelHandler

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

uft-8 MAFileModelHandler

Nick
In Pier on Seaside 3, if I use a utf-8 encoded Comanche Adapter, I receive a walkback "MNU: ByteArray>>isByteString"
The error is generated from:

GRPharoUtf8CodecStream>>nextPutAll
nextPutAll: aString
binary
ifTrue: [ stream nextPutAll: aString asString ]
ifFalse: [
aString isByteString
ifTrue: [ self encodeFast: aString ]
ifFalse: [ self encodeDefault: aString ] ]

while trying to serve "style.css" which originates from:

PRStructure>>defaultEnvironment
^ (PRPage named: 'environment')
addChild: ((PRFile named: 'style.css')
filename: 'style.css';
mimetype: 'text/css';
contents: '/* blueprint patches */........

To reproduce:
1 Download the one-click 3.0a5 release from seaside.st
2 Select utf-8 encoding on the WAComancheAdapter (right click within Seaside Control Panel -> Encoding...)
3 Browse to localhost:8080/pier

There seem to be a number of places where a fix could be made, but I'm not sure which (if any) would be the most appropriate:
* MAFileModelHandler>>handleFiltered - the GRPharoUtf8CodecStream response stream is created, without utf-8 encoding, a GRNullCodecStream is created instead.
* PRFile>>contents: perhaps PRFile shouldn't always convert the contents to a ByteArray
* Perhaps ByteArray should implement isByteString.

Any thoughts?

Nick




_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: uft-8 MAFileModelHandler

Philippe Marschall
2010/1/25 Nick Ager <[hidden email]>:
> In Pier on Seaside 3, if I use a utf-8 encoded Comanche Adapter, I receive a
> walkback "MNU: ByteArray>>isByteString"

Nice. IMO the way to go is that Pier puts the response stream into
binary mode before pushing binary content.

Cheers
Philippe
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki