]>
Commit | Line | Data |
---|---|---|
b5ae0dbf | 1 | --- cvsspam-0.2.12/cvsspam.rb 2010-04-07 18:27:22.000000000 +0300 |
23914c10 | 2 | +++ cvsspam-0.2.12/cvsspam.rb 2010-04-07 18:27:22.000000000 +0300 |
b5ae0dbf | 3 | @@ -171,7 +171,7 @@ |
23914c10 ER |
4 | |
5 | # test to see of the given string contains non-ASCII characters | |
6 | def requires_rfc2047?(word) | |
7 | - (word =~ /[\177-\377]/) != nil | |
8 | + (word.force_encoding('ASCII-8BIT') =~ /[\177-\377]/) != nil | |
9 | end | |
10 | end | |
11 | ||
b5ae0dbf ER |
12 | @@ -1680,7 +1680,7 @@ |
13 | cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" | |
14 | $config = "#{cvsroot_dir}/cvsspam.conf" | |
15 | $users_file = "#{cvsroot_dir}/users" | |
16 | -$users_file_charset = nil | |
17 | +$users_file_charset = 'utf-8' | |
18 | ||
19 | $debug = false | |
20 | $svn = false | |
21 | @@ -2244,6 +2244,7 @@ | |
23914c10 ER |
22 | if File.exists?($users_file) |
23 | File.open($users_file) do |io| | |
24 | io.each_line do |line| | |
25 | + line.force_encoding($users_file_charset) | |
26 | if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/ | |
27 | if email.address == $1 | |
28 | return EmailAddress.new($3, $users_file_charset) |