diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-09-20 16:55:06 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-11-08 17:07:36 +0000 |
commit | a83b379fd2d676172855825d0592937b234371e2 (patch) | |
tree | 6a9c2abddd410f02488093d5c54f7c855b9a0560 /script/user-use-graph | |
parent | 9dd0b8b27bc7072c7e6afe54ff3693f653b7c90c (diff) |
Don't read the saved mail in binary mode.
The first reason for doing this is that atomic_write doesn't write in binary mode, and I think we should be symmetrical in reading and writing.
The second reason is that I don't think a received email is really binary data in its raw form. I think it will be ascii with non ascii parts converted to ascii using content-transfer-encodings (http://en.wikipedia.org/wiki/MIME).
This matters in Ruby 1.9 because we have a default internal and external encoding (http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings).
UTF-8 seems like a good initial default to set. If we retrieve this data from a file as binary data, we have a problem treating it as text, as we can't convert from binary to text in Ruby 1.9. Given that this is ascii data, I think we can safely treat it as UTF-8 (which should be a superset of ascii), until we convert it into a mail object, which should interpret the mime encodings correctly.
Diffstat (limited to 'script/user-use-graph')
0 files changed, 0 insertions, 0 deletions