moll / mina-rsync

Deploy with Rsync from any local (or remote) repository when using Mina.
Other
50 stars 25 forks source link

Add encoding: utf-8 to fix error while importing #6

Open Daan- opened 10 years ago

Daan- commented 10 years ago

Error: invalid multibyte char (US-ASCII)

moll commented 10 years ago

Hey, thanks for sharing your caring! I believe you could also set the RUBYOPT env variable to -Ku which might be a more universal solution. :)

Let me know if that works!

Daan- commented 10 years ago

That will probably work, but this seems a bit more universal. I would rather not have to set the RUBYOPT environment on every production server specifically for this gem..

moll commented 10 years ago

Hmm, how does the whole Ruby eco work around this without polluting every file with explicit encoding comments? I've so far always set RUBYOPT in shell rcs and in Upstart init scripts that start Ruby because of not defaulting to UTF-8 seems more like a bug than a feature of Ruby. That was strictly a v1.9 "bug", right? I guess it's triggered from my last name's "ö" character in this particular case.

Daan- commented 10 years ago

Yes it's triggered by the "ö". Ruby 2.1 (which is installed on the server) should not have this bug, but strangely I still get the error. Luckily, only this file triggers the error, so this single line should fix it for everyone. I have no clue on how other Ruby projects handle this, generally it seems not to be a problem, as there are very little files which have special characters. However I recall seeing the same line in Rails localization files.