aquasync / ruby-msg

A library for reading and converting Outlook msg and pst files (mapi message stores)
MIT License
96 stars 31 forks source link

Fixes #15 and Fixes #9 #16

Open acolchagoff opened 5 years ago

acolchagoff commented 5 years ago

Here's my take on the UTF-8 fix.

acolchagoff commented 5 years ago

After spending sever hours on this I've concluded that Ruby just wants to use UTF-8, in order to get this all to play nice with ASCII-8BIT we would need to force ascii encoding all over the place. it would be ridiculous. Unless someone has a way to specifically change encoding to ascii all string operations in an entire class, I believe this is the only real solution to this problem.

pshires commented 5 years ago

This helped me with some issues I was running into, thanks!

acolchagoff commented 5 years ago

@aquasync can I get your feedback here?

aquasync commented 5 years ago

Hey @denodster, sorry haven't really had time to look at this of late. While your fix sort of works, I've discussed briefly on another issue here, what I think is the right way forward - essentially that mime objects should be treated as binary rather than encoded text. It shouldn't be too much work to fix, though whether it makes sense to do that or just move it to using an external library for the rfc822/2045 stuff I'm not sure (I started down that track with tmail a long time ago).

acolchagoff commented 5 years ago

@aquasync I fear you're letting 'great' be the enemy of 'good' here. This gem crashes with quite a few of the emails I throw at it and the fix I've implemented has worked fine for me so far. Your idea is great, but I really wouldn't know where to start and it appears that in 5+ years no one else has taken a wack at it either. Perhaps make a TODO to do it your way when the opportunity comes along or another bug presents itself? The current version of the gem is pretty broken because of this issue. I was using the release in production and we had quite a few people encounter this crash. If you disagree, I understand, and I'll stick with our fork until either I have time to do this the better way or you get around to it.