Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

We were seeing some misencoded characters #39

Open
wycats opened this Issue · 3 comments

3 participants

@wycats
Owner

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

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
Owner

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

@hennk

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
Something went wrong with that request. Please try again.