This project is archived and is in readonly mode.
Add magic encoding comment to generated files
-
Aaron Patterson
- Assigned user set to Aaron Patterson
-
Bruno Michel
- Importance changed from to Low
You can add a comment in app/helpers/application_helper.rb to make it works:
# encoding: utf-8It says to ruby-1.9.2 that strings in this particular file should be considered as encoded in 'utf-8' (and not 'ascii', the default value).
-
Aditya Sanghi
I recently saw a patch that would automatically put the encoding in some generated files in Ruby > 1.9. Do you think a patch would be good to extend this in other files generated by Rails, such as the layout, application_helper.rb etc?
@fakingfantastic, I too confirm that adding the line as @bruno suggests solves the problem.
-
Aditya Sanghi
@fakingfantastic one more thing, i actually bothered to open your zip file and have a look just now. You cant just put » in your helper WITHOUT quotes.
That's just wrong, no? I mean » is not a variable or a method, if you want it treated like a string you need to quote it.
-
David Trasbo
- State changed from new to invalid
Aditya is right. In order to make this work you do need the quotes and setting the encoding at the top of the file. As long as you don't specify the encoding, though, quotes or no quotes, the error will always be there.
Marking this invalid.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
