emersion / go-message

✉️ A streaming Go library for the Internet Message Format and mail messages
MIT License
373 stars 108 forks source link

Support iso-8859-1 encoding #180

Closed quzhi1 closed 1 month ago

quzhi1 commented 1 month ago

Hello @emersion ,

Can I add support to iso-8859-1 encoding? I saw this encoding is supported in charset.go, but not encoding.go: https://github.com/emersion/go-message/blob/master/charset/charset.go#L27

I am fairly new to this library. Please let me know if I need to make more changes to support iso-8859-1.

ps: Can I add some more encodings? I can do it as part of this PR.

Thank you.

Zhi Qu

quzhi1 commented 1 month ago

@emersion I added a list of popular encodings. In that way we can parse emails a lot easier. Can you take a look? 🙏

emersion commented 1 month ago

The way the library is designed, by default no encodings are included so that the library doesn't result in a much bigger binary size. Users can opt-in to import common encodings. See https://pkg.go.dev/github.com/emersion/go-message#pkg-overview

quzhi1 commented 1 month ago

Thank you @emersion ! I just tested and it works. PR is closed.