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

Help with unsupported charsets #17

Closed
deepakprabhakara opened this issue Dec 22, 2016 · 8 comments
Closed

Help with unsupported charsets #17

deepakprabhakara opened this issue Dec 22, 2016 · 8 comments

Comments

@deepakprabhakara
Copy link
Contributor

I have collected a small list of logs for unsupported charsets. Here's the list:-

  • ISO646-US
  • ISO: Western
  • cp936
  • cp-850
  • 136
  • utf-7
  • ibm850

As far as I understand ISO646-US is "us-ascii", ISO: Western is "iso8859" and cp936 is "gb2312". Is this correct?

I have been unable to figure out the rest of the encodings although cp-850 and ibm850 seem to be the same.

Does anyone have an idea about these charsets and if they can be supported in this library easily?

@deepakprabhakara
Copy link
Contributor Author

Looks like cp-850 and ibm850 is charmap.CodePage850

@jhillyerd
Copy link
Owner

jhillyerd commented Dec 30, 2016

Looks like you took care of most of these. Seems like Go does not support UTF-7 out of the box, not sure if that's because Rob Pike invented UTF-8 and doesn't want it. We could leverage:

https://github.com/cention-sany/utf7

@cention-sany appears to make use of a heavily modified version of the older go.enmime

I'd like to avoid adding a bunch of dependencies if possible, but I'd rather one import than bring in iconv, since it wraps a C library; complicating the build.

@deepakprabhakara
Copy link
Contributor Author

Sounds good to me, I'd avoid iconv as well.

@jhillyerd
Copy link
Owner

Looks like https://github.com/emersion/go-imap/tree/v1/utf7 may be a more idiomatic implementation. Turns out that UTF-7 was actually defined in the IMAP RFC.

@cention-sany
Copy link
Contributor

Just wanna comment that package https://github.com/cention-sany/utf7 is https://tools.ietf.org/html/rfc2152 compliance meanwhile https://github.com/emersion/go-imap/tree/v1/utf7 seem to be https://tools.ietf.org/html/rfc3501#section-5.1.3 which actually two slightly different UTF-7.

@jhillyerd
Copy link
Owner

Good to know, skimming rfc2152, it was specifically designed for internet mail content, so your implementation would be the better choice for enmime.

@jhillyerd jhillyerd added this to the v0.4.0 milestone Nov 1, 2018
@jhillyerd jhillyerd modified the milestones: v0.4.0, v1.0.0 Nov 24, 2018
@jhillyerd jhillyerd self-assigned this Feb 23, 2020
jhillyerd added a commit that referenced this issue Feb 23, 2020
Added
- Inject a `application/octet-stream` as default content type when none is
  present (#140, thanks requaos)
- Add support for content-type params to part & encoding (#148, thanks
  pzeinlinger)
- UTF-7 support (#17)

Fixed
- Handle missing parameter values in the middle of the media parameter list
  (#139, thanks requaos)
- Fix boundaryReader to respect length instead of capacity (#145, thanks
  dcormier)
- Handle very empty mime parts (#144, thanks dcormier)
@deepakprabhakara
Copy link
Contributor Author

@jhillyerd Nice one

@jhillyerd
Copy link
Owner

jhillyerd commented Feb 24, 2020

If I had known it was only going to take 3 lines of code to implement, I might not have waited two years to fix this. 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants