attachments 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/attachments.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'attachments/extract.rb'
2
4
  require 'attachments/filemagic.rb'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'rubygems'
2
4
  require 'uuidtools'
3
5
  require 'fileutils'
@@ -32,7 +34,13 @@ module Attachments
32
34
  @last_parsed = filename
33
35
 
34
36
  # Load the email
35
- @mail = Mail.read(filename)
37
+ m = File.read(filename)
38
+ begin
39
+ m.force_encoding("UTF-8")
40
+ rescue
41
+ # force_encoding not supported in ruby 1.8
42
+ end
43
+ @mail = Mail.new(m)
36
44
 
37
45
  # Parse parts recursively until it is not multipart
38
46
  # Ignore types that are not suited for forwarding
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
 
2
3
  class FileMagic
3
4
  def self.mime filename
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attachments
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rune Myrland
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-13 00:00:00 +02:00
18
+ date: 2010-08-14 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency