Rails error: invalid byte sequence in UTF-8

Hello,

i have a app on rails 3.2.1 and i use a jquery lib called jQuery Timelinr 0.9.5: http://www.csslab.cl/2011/08/18/jquery-timelinr/

but, when i use it on a .erb view, i got a error:

Showing /home/carlos.ribeiro/projetos/amarribo/app/views/conheca/historico.html.erb where line #59 raised:

invalid byte sequence in UTF-8

Extracted source (around line #59):

57: 58: <%= stylesheet_link_tag "timeline" %>
59: <%= javascript_include_tag "timeline/jquery.timelinr-0.9.51" %>
60: 61: <script>
62: $(function(){

but when i remove the line 59, the error stop.

Anybody have an idea about it???

thanks.

Maybe this help

http://stackoverflow.com/questions/7837350/sprockets-encoding-error-on-js-file-invalid-utf-8-byte-sequence

https://github.com/sstephenson/sprockets/issues/87#issuecomment-1344825

when i execute this rake task https://gist.github.com/1301199/a19adcb7687f2adfc927c9e8da3d716960833797 , don’t return me errors, all file is ok…

I’ve used this file

https://github.com/juanbrujo/jQuery-Timelinr/blob/master/js/jquery.timelinr-0.9.5.js

I’ve downloaded it and then in irb did

f = File.read("/path/to/jquery.timelinr-0.9.5.js")

f.valid_encoding?

=> true

f.encoding

=> #Encoding:UTF-8

maybe there’s a typo in the file you are using (something like the question in stackoverflow)

i’m using this file too…

in irb is ok, but when is in rails, a i got the problem…