aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/incoming_message.rb4
-rw-r--r--lib/alaveteli_external_command.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 8e48d75d2..91f1cf7c0 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -943,8 +943,8 @@ class IncomingMessage < ActiveRecord::Base
# lynx wordwraps links in its output, which then don't
# get formatted properly by Alaveteli. We use elinks
# instead, which doesn't do that.
- AlaveteliExternalCommand.run("elinks", "-eval", "'set document.codepage.assume = \"#{charset}\"'", "-eval", "'set document.codepage.force_assumed = 1'", "-dump-charset", "utf-8", "-force-html", "-dump",
- tempfile.path, :append_to => text)
+ AlaveteliExternalCommand.run("elinks", "-eval", "set document.codepage.assume = \"#{charset}\"", "-eval", "set document.codepage.force_assumed = 1", "-dump-charset", "utf-8", "-force-html", "-dump",
+ tempfile.path, :append_to => text, :env => {"LANG" => "C"})
elsif content_type == 'application/vnd.ms-excel'
# Bit crazy using /usr/bin/strings - but xls2csv, xlhtml and
# py_xls2txt only extract text from cells, not from floating
diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb
index 737b48fa9..b1d4f17d1 100644
--- a/lib/alaveteli_external_command.rb
+++ b/lib/alaveteli_external_command.rb
@@ -30,7 +30,7 @@ module AlaveteliExternalCommand
if opts.has_key? :append_to
xc.out = opts[:append_to]
end
- xc.run(opts[:stdin_string])
+ xc.run(opts[:stdin_string], opts[:env] || {})
if xc.status != 0
# Error
$stderr.puts("Error from #{program_name} #{args.join(' ')}:")