Permalink
Browse files

Merge branch 'ruby1.9' of https://github.com/enricob/domainatrix into…

… enricob-ruby1.9
  • Loading branch information...
2 parents e23fc35 + 2b40215 commit 67383eac950644d4e002fc5d6865625dad1a03ca Paul Dix committed Apr 8, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/domainatrix/domain_parser.rb
@@ -10,7 +10,14 @@ def initialize(file_name)
end
def read_dat_file(file_name)
- File.readlines(file_name).each do |line|
+ # If we're in 1.9, make sure we're opening it in UTF-8
+ if RUBY_VERSION >= '1.9'
+ dat_file = File.open(file_name, "r:UTF-8")
+ else
+ dat_file = File.open(file_name)
+ end
+
+ dat_file.each_line do |line|
line = line.strip
unless (line =~ /\/\//) || line.empty?
parts = line.split(".").reverse

0 comments on commit 67383ea

Please sign in to comment.