[Q] WAListener and WAFileLibrary problem
philippe.marschall at gmail.com
Fri Jan 4 11:40:57 UTC 2008
2008/1/3, chunsj at embian.com <chunsj at embian.com>:
> I've managed to find and modify WAListenerEncoded so that it can process
> multibyte language - I've only tested it with Korean as UTF-8. During testing
> I found following problem.
Korean as UTF-8 should not work on WAListenerEncoded. If it does then
it's a bug in WAListenerEncoded. The reason for this is that Korean as
UTF-8 violates the contract between the server adapter and you. The
*Encoded* adapters give you Strings in Squeak encoding (well not quite
in the case of CJK because that is not possible since Unicode does not
have the concept of language tags) but in turn expect Strings in
Squeak encoding. In the case of Korean this means WideStrings. UTF-8
Strings are ByteStrings and should therefore not work.
> When I use WAListener/WAListenerEncoded I cannot get FileLibrary registered
> image files correctly. I can get CSS file or script file correctly, but I cannot get
> image files.
I don't think WAListenerEncoded can ever work for binary files. The
problem is that due to it's streaming nature WAListenerEncoded
compared to WAKomEncoded can never look at the response. This means it
can never decide wehter is should do encoding (based on the mimetype),
so it always does it. In the case of binary content this is clearly
wrong. Your best option (as always) is to serve static files (images,
> It seems that when I use WAListener, the server sent the image file of the size
> of 16135 byte, but original file size is 10819 byte, and this might be the source
> of the problem. I cannot open wrong sized file even though I cut the size of the
> file to the original one.
WAListener should not do any encoding at all so images should work.
But then again we don't know what code you changed so we can't really
help you. It would help if you send us the image so we can test.
More information about the Squeak-dev