Comments (4)
I am not a Seaside specialist, let alone on any port, but I don't think it is Seaside's job to fix encoding issues or other trouble.
If you have a String that is actually UTF-8 encoded bytes, then the problem is how you got there, it should be fixed there and then.
Obviously Seaside is capable of serving any binary file correctly (as it does in its file libraries in lots of variations), so technically anything should be possible.
from seaside.
I am not a Seaside specialist, let alone on any port, but I don't think it is Seaside's job to fix encoding issues or other trouble.
This is exactly the rationale behind the issue, you should be able to send a WADocument with whatever content and encoding you want and Seaside should not alter it. By default it encodes it, but if you want to send it as is you should have an option.
If you have a String that is actually UTF-8 encoded bytes, then the problem is how you got there, it should be fixed there and then.
I agree with this as well... but if WAFileLibrary compiles as a return String the extensions for which it interprets as non-binary MIME types, then you're on Seaside's hands. Compiling everything read from disk as ByteArray should have been the initial choice, but here we are...
from seaside.
This is exactly the rationale behind the issue, you should be able to send a WADocument with whatever content and encoding you want and Seaside should not alter it. By default it encodes it, but if you want to send it as is you should have an option.
I am pretty sure that already works, after all that is what the file library and handler already do (i.e. taking bytes, as for an image and serving them unaltered with any mime type). At least as far as I can see in Pharo / Seaside 3.
Are you sure this is not related the VAST Seaside port/implementation ? Did you try anywhere else ?
from seaside.
I did not try, but now I did and I noticed GRPharoPlatform>>readFileStreamOn:do:binary:
forces the input stream to be valid UTF-8, so anything other than valid UTF-8 cannot be read.
So If I want to read an ISO-8859-1 or Windows 949 (Korean) encoded file in Pharo, it doesn't work (I tried).
I guess it is because it forces a "MIME type" to be compiled as a String
(or WideString
), instead of being a ByteArray
. So in Pharo, for UTF-8 encoded files, each character in the literal compiled string will be a Character
with a valid Unicode codepoint (without any clustering), which when reencoded in the output will produce the same UTF-8 bytes.
I'll think in how to work around this, maybe the changes must be applied ONLY in the VAST adaptor layer, as I don't foresee anything changing GRPharoPlatform>>readFileStreamOn:do:binary:
to read non UTF-8 encoded files.
Thanks for the input.
from seaside.
Related Issues (20)
- testCORSFilterFunctionalTest is broken on github CI HOT 3
- JQAjax>>#callback:json: and invalid json HOT 9
- Dictionary>>#asJson does not produce valid JSON when using integer keys HOT 6
- WAGettextExporter catalog generation issues
- It is not fully clear why the session cache settings are described two times at /config
- WAPharoInspector cannot evaluate (compile) expressions in Pharo 11 HOT 1
- WAFastCGIAdaptor doesn’t write cookie attributes ‘Max-Age’ and ‘SameSite’ HOT 2
- WAFastCGIRequestConverter>>#requestUrlFor: signals a WAInvalidUrlSyntaxError when the ‘REQUEST_URI’ is ‘/?://’
- Nested script tags are not properly escaped HOT 2
- PackageManifest extensions should not be loaded in Squeak HOT 4
- Squeak does not have an implementation of Integer>>#asByteArray HOT 9
- Squeak WAVNCController>>#uiProcess should use Project, not UIManager
- Squeak has no #isImmediateObject HOT 4
- Squeak needs variant implementation of #openDebuggerOn: HOT 3
- Squeak WAVersionUploader>>#newVersion: needs to make sure the RWBinaryOrTextStream is ascii HOT 2
- Squeak WAWebServerAdaptor>>#responseFrom: sends #oldNetscapeString HOT 3
- WAAdmin clearSessions does not clear sessions on GemStone
- Squeak needs version of WAInspector HOT 1
- Squeak WAVNCController>>#renderContentOn: needs to test existence of a vnc server before asking if it is running HOT 2
- WAServerAdaptor>>#handlePadding: needed anymore ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seaside.