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

We were seeing some misencoded characters #39

Open
wycats opened this issue Jan 4, 2012 · 3 comments
Open

We were seeing some misencoded characters #39

wycats opened this issue Jan 4, 2012 · 3 comments

Comments

@wycats
Copy link
Contributor

wycats commented Jan 4, 2012

We need to investigate whether there are cases where characters become misencoded. This may well be resolved, but we were seeing it in the early days of rake-pipeline and should investigate.

@hennk
Copy link

hennk commented May 23, 2012

I just had the same problem in one of my projects. In my case, the cause was that the generated file had jquery and ember prepended, which do not contain any non-ASCII chars (ember does have the copyright char, but at the end of its file). As the integrated web server of rake pipeline does not seem to specify the encoding, browser sniffing fails, as the first non-ASCII char is found only very far into the file.

One solution is the following filter, prepending each file with a BOM:


class BOMFilter < Rake::Pipeline::Filter
  def generate_output(inputs, output)
    inputs.each do |input|
      output.write("\uFEFF" + input.read)
    end
  end
end

Although I guess a better solution would be for the integrated webserver to specify the encoding for the served files.

@wagenet
Copy link
Contributor

wagenet commented Nov 13, 2012

I think we still have a misencoded copyright char in Ember.

@hennk
Copy link

hennk commented Nov 13, 2012

Github downloads actually suffer the same problem as described by me earlier. For example, opening http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.7.1.js in a browser, will display the copyright char at the bottom incorrectly, as the Github download server does not send an encoding in the HTTP headers, and apparently the browser, after seeing the first X lines of pure ASCII, does not interpret it as UTF8.

If you download the same file directly, it is valid UTF8.

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

3 participants