Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support MS950 encoding #1417

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tonytonyjan
Copy link

@tonytonyjan tonytonyjan commented Oct 15, 2020

This pull request fixes #1406

Mail::Encodings.value_decode '=?MS950?B?rue26aWrrEapssS1ue6nvaXms3G5SLNX?= =?MS950?B?wMvBfLFNsM/Ay8F8pEirSL1jpmGnfcXn?= =?MS950?B?w9KhXaa5q0il86ywqHSyzqbbsMq1b7Bl?= =?MS950?B?oUG90MJJv++kVaTos3O1sqFBpMWmXrRfKQ==?='"
# => 桃園市政府警察局交通違規檢舉專區檢舉人信箱地址驗證(此信件為系統自動發送,請點選下方連結,勿回復)

It seems like there are 2 places where we can put the test. I picked the first one, let me know if there is a better place for testing.

{
"latin2" => Encoding::ISO_8859_2,
"ISO_8859-1" => Encoding::ISO_8859_1,
"cp-850" => Encoding::CP850,
"" => Encoding::BINARY
}.each do |from, to|
it "should support #{from}" do
expect { ::Encoding.find(from) }.to raise_error(ArgumentError)
expect(Mail::Ruby19.pick_encoding(from)).to eq(to)
end
end

describe ".pick_encoding" do
it "finds encoding" do
if RUBY_VERSION >= "1.9"
expect(Mail::Ruby19.pick_encoding("Windows-1252")).to eq Encoding::Windows_1252
end
end
it "uses binary for unfound" do
if RUBY_VERSION >= "1.9"
expect(Mail::Ruby19.pick_encoding("ISO-Foo")).to eq Encoding::BINARY
end
end
end

@lulalala
Copy link

bump!

@mikel
Copy link
Owner

mikel commented Dec 3, 2022

Hey there @tonytonyjan and @lulalala happy to get this merged in, could you please bring it up to date against Master?

@tonytonyjan
Copy link
Author

Hey there @tonytonyjan and @lulalala happy to get this merged in, could you please bring it up to date against Master?

Thanks for the reminder. I have updated the change. Thank you!

@mikel mikel added this to the 2.9.0 milestone Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mail::Encodings.value_decode cannot decode MS950 charset.
3 participants