Answer the question
In order to leave comments, you need to log in
Calling a shell command containing Russian characters in ruby?
Good afternoon.
Calling a console command
cmd = '/usr/bin/mediainfo "/var/avalon/dropbox/Лекции_для_молодых_ученых/Nabiullin_SciERes_1.flv" --Output=XML'
out = `#{cmd}`
Answer the question
In order to leave comments, you need to log in
The problem is that for avalon ENV["LANG"] = С
. ENV["LANG"]='en_US.utf-8'
solved a problem.
Thanks to all.
Seems to be a bug in mediainfo . Is it working fine locally? What OS?
Try it step by step:
1) Check the command manually in the console (bash)
2) Check the operation of the gem in the rails console, and not just in irb, some gems may conflict: bundle exec rails c
3) Check the encoding of the string with the file name (conveniently do it through the pry-rails gem, put binding.pry in the right place and debug it)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question