mina-rsync icon indicating copy to clipboard operation
mina-rsync copied to clipboard

Add encoding: utf-8 to fix error while importing

Open Daan- opened this issue 10 years ago • 4 comments

Error: invalid multibyte char (US-ASCII)

Daan- avatar Apr 07 '14 16:04 Daan-

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!

moll avatar Apr 07 '14 16:04 moll

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..

Daan- avatar Apr 07 '14 17:04 Daan-

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.

moll avatar Apr 07 '14 17:04 moll

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.

Daan- avatar Apr 15 '14 20:04 Daan-