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

JSON encoding not specified #83

Open
dreger opened this issue Mar 19, 2015 · 9 comments
Open

JSON encoding not specified #83

dreger opened this issue Mar 19, 2015 · 9 comments

Comments

@dreger
Copy link

dreger commented Mar 19, 2015

Regarding a potential fix for 18F/analytics.usa.gov/issues/149, it looks like app/routes.js isn't specifying the character set for the returned JSON. Pulled from StackOverflow #16268244:

Set the res.header("Content-Type", "application/json; charset=utf-8"); so that the browser knows what character set to use.

@dreger dreger changed the title JSON Encoding issue JSON encoding not specified Mar 19, 2015
@cmc333333
Copy link

+1 this solution. The file command thinks the output is UTF-8 encoded, and vim (being utf-8 aware) displays the characters correctly

@konklone
Copy link
Contributor

The dashboard gets JSON from S3 - the Express endpoints here are not currently used in production. This is a good note and we'll integrate the fix, but it won't resolve 18F/analytics.usa.gov#149.

@shawnbot
Copy link

Won't S3 let you set the Content-Type header to include the encoding?

@dreger
Copy link
Author

dreger commented Mar 20, 2015

@shawnbot It looks like the content encoding is getting set to gzip?

https://github.com/18F/analytics-reporter/blob/master/bin/analytics#L42-L49

@konklone
Copy link
Contributor

We should update the Content-Type, not the Content-Encoding. Thanks for pointing this out -- we'll fix.

@shawnbot
Copy link

Yeah sorry, I meant that the Content-Type header should be set to application/json; charset=utf-8 on S3, rather than just application/json.

@ArcTanSusan
Copy link
Contributor

Was this what you had in mind? #128

@gbinal
Copy link
Member

gbinal commented May 30, 2017

@jmhooper, @laurenancona, anyone else here - game to check if #128 resolved this issue?

@jmhooper
Copy link
Member

jmhooper commented Jun 5, 2017

@gbinal: I believe it would have, but that is dead code now.

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

7 participants