15

A Sprockets::EncodingError exception is thrown when I include a file with characters that are valid utf-8.

The line in question is:

* Copyright (c) 2010 - 2011 Johan Säll Larsson

If I replace the ä character, the problem goes away, but I don't want to have to remember to edit this vendor file everytime I update it.

How can I fix this?

2 Answers 2

45

I found the solution via the comments on this Sprockets issue:

I simply saved the file as utf-8, (TextMate has an option to do this when you chose 'Save As'), and the problem went away.

The commenter @shedd also created a useful rake task to find assets which are not encoded properly.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this worked for me. In SublimeText2 you can fix it via File > Save with Encoding > UTF8.
1

This is fixed in trunk. All files use utf-8 without BOM.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.