--- cvsspam-0.2.12/cvsspam.rb 2010-04-07 18:27:22.000000000 +0300 +++ cvsspam-0.2.12/cvsspam.rb 2010-04-07 18:27:22.000000000 +0300 @@ -171,7 +171,7 @@ # test to see of the given string contains non-ASCII characters def requires_rfc2047?(word) - (word =~ /[\177-\377]/) != nil + (word.force_encoding('ASCII-8BIT') =~ /[\177-\377]/) != nil end end @@ -1680,7 +1680,7 @@ cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT" $config = "#{cvsroot_dir}/cvsspam.conf" $users_file = "#{cvsroot_dir}/users" -$users_file_charset = nil +$users_file_charset = 'utf-8' $debug = false $svn = false @@ -2244,6 +2244,7 @@ if File.exists?($users_file) File.open($users_file) do |io| io.each_line do |line| + line.force_encoding($users_file_charset) if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/ if email.address == $1 return EmailAddress.new($3, $users_file_charset)