-
Notifications
You must be signed in to change notification settings - Fork 64
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
UTF-8 Javascipt is not served properly in development mode #62
Comments
Ah ok you will need charset I'll get this in and a test case in place to make sure this doesn't come back :) it seems jdk7 on OS X switched default encoding to utf-8 so it wasn't appearing. Sent from my iPhone
|
Got it couple things, It was simply a matter of setting the response character encoding. But note on encoding differences between development and war/production. In development, encode detection is handled by both the //=encoding directive and the charset=utf8 attribute. Make sure you add //=encoding utf8 on the root javascript file you plan on using (your js manifest). This way when the assets are precompiled for production the system has a way to infer the desired encoding for compilation. You should be able to give this a shot in asset-pipeline version 1.5.4 Thanks, On Feb 19, 2014, at 7:11 AM, David Estes davydotcom@gmail.com wrote:
|
Resolved |
I have been using Struts2 and recently switched to Grails 2.3.1.
I have tried using asset pipeline version 1.5.3. However, when I am trying to serving a Javascript library which contains Unicode characters, I found that it does not properly serve the Javacsript file.
Environment
How to reproduce
Things to note
What I have tried
Thoughts and Possible Solution
Obviously it is something related to character encoding, however it can happen in several areas
After some tracing I found that the Grails controller AssetsController maybe the cause of problem.
Git commit: 3266b01
Source file: https://github.com/bertramdev/asset-pipeline/blob/3266b0168219723753b617c1ea391c4469ec68e8/grails-app/controllers/asset/pipeline/AssetsController.groovy
The code "response.outputStream << assetFile" seems not specifying any encoding.
So I made some minor changes to:
Here is the code fix: (marked with // FIX between)
The text was updated successfully, but these errors were encountered: