Skip to content

Iso 2022 jp - implement charset codec #595

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yujiyokoo
Copy link

With help from @kuroda and @mikel, I have implemented the CharsetCodec which @jeremy suggested in the original PR (#534).

I have simply moved things around - it should work exactly the same as the original iso-2022-jp branch AFAIK.

kuroda and others added 4 commits April 12, 2013 01:41
These patches introduce some special treatments for ISO-2022-JP
encoding (so-called JIS-code), which is the de facto standard
when we send an email written in Japanese language.

These patches have effects only when a Mail object is
instanciated with :charset => 'ISO-2022-JP' option.
With this option, the header values and body text are
automatically converted from UTF-8 to ISO-2022-JP.

Note that some characters are replaced with other
characters before this conversion takes place
in order to solve problems on some platforms.

See https://github.com/kuroda/mail-iso-2022-jp for details.
@jeremy
Copy link
Collaborator

jeremy commented Aug 8, 2013

Nice work. Thank you! It's good to see big blocks of red in the diff.

end

def set_charset_on(message)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a ! method?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On further review, this doesn't look like the codec's responsibility.

The codec is converting "messy" external encoding to a clean internal encoding.

So the codec should expose its internal charset, then have calling code do something like message.charset = codec.charset instead of codec.set_charset_on message.

@jeremy
Copy link
Collaborator

jeremy commented Aug 8, 2013

I made some comments on method naming and separation of responsibilities. Thanks again! 👍

@thorsteneckel
Copy link

Hey @yujiyokoo, @kuroda and @mikel 👋 One of our users over at https://github.com/zammad/zammad stumbled across this issue earlier this year and now one of our paying customers is affected as well. Therefore this topic gets a certain priority and we were wondering what we can contribute to enable this great gem to support Iso 2022 jp mails. Could you please give us a short update on the current state of this PR - which seems to be staled for nearly 6 years by now. We'd like to pick things up and get this merged into the latest version. Looking forward do hear from you. Bests, Thorsten

@kuroda
Copy link

kuroda commented Jul 2, 2019

@thorsteneckel

The mail-iso-2022-jp is a hacked version of another gem that was maintained on https://github.com/ma2shita/mail_ja.

I managed to make this gem work, but I did not have a solid understanding of the internal structure.

So I couldn't answer the question from @jeremy.

I think it is very difficult to save this six year old PR.

@yujiyokoo
Copy link
Author

Yeah I think @kuroda is right. It's very hard to save such an old PR.

Back then, I tried working on this for a while, and was intending to do more work on it but unfortunately other things got prioritised over it and I didn't know a lot about the internals of this either :(

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.

5 participants