Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Encoding For Transit Middleware #9

Open
adstage-david opened this issue Jul 20, 2016 · 0 comments
Open

Default Encoding For Transit Middleware #9

adstage-david opened this issue Jul 20, 2016 · 0 comments

Comments

@adstage-david
Copy link

Traced back an encoding issue only happening in production in our Untangled app to a JVM configuration option - specifically, locally I was using equivalent of -Dfile.encoding=utf-8 JVM_OPTS flag (actually had an environment variable: export LC_ALL=en_US.utf8, but Java uses that if file.encoding not set, apparently)

Seems like the transit encoder, since it is not told which encoding to use, just uses system default, which might change based on where an app is deployed - so probably not good to leave this behavior undefined.

Context from @mahinshaw on Slack:

This looks useful.  We could change the writer to always write UTF-8.  My guess i there is an environment issue with the ByteArrayOutputStream on your system.  It could be configureable too.

https://github.com/untangled-web/untangled-server/blob/master/src/untangled/server/impl/middleware.clj#L7

Last link is the transit write

line 11 `ret (.toString baos)` => `ret (.toString baos "UTF-8")`

It might be worth testing that with checkouts in your environment and seeing it it resolves something

It should definitely be configurable, but in the end, fall back to utf-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant