mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
Fix for non-english email polling.
This commit is contained in:
parent
b8e63719f8
commit
c86b06e3fa
@ -26,7 +26,7 @@ module Email
|
||||
return Email::Receiver.results[:unprocessable] if @body.blank?
|
||||
|
||||
# Then run the github EmailReplyParser on it in case we didn't catch it
|
||||
@body = EmailReplyParser.read(@body).visible_text
|
||||
@body = EmailReplyParser.read(@body).visible_text.force_encoding('UTF-8')
|
||||
|
||||
discourse_email_parser
|
||||
|
||||
|
@ -50,6 +50,17 @@ stripped from my reply?")
|
||||
end
|
||||
end
|
||||
|
||||
describe "It supports a non english reply" do
|
||||
let(:hebrew) { File.read("#{Rails.root}/spec/fixtures/emails/hebrew.eml") }
|
||||
let(:receiver) { Email::Receiver.new(hebrew) }
|
||||
|
||||
it "processes correctly" do
|
||||
I18n.expects(:t).with('user_notifications.previous_discussion').returns('כלטוב')
|
||||
receiver.process
|
||||
expect(receiver.body).to eq("שלום")
|
||||
end
|
||||
end
|
||||
|
||||
describe "via" do
|
||||
let(:wrote) { File.read("#{Rails.root}/spec/fixtures/emails/via_line.eml") }
|
||||
let(:receiver) { Email::Receiver.new(wrote) }
|
||||
|
BIN
spec/fixtures/emails/hebrew.eml
vendored
Normal file
BIN
spec/fixtures/emails/hebrew.eml
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user