myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3441] trunk/lib/country_codes.rb: fixed string e


From: noreply
Subject: [myexperiment-hackers] [3441] trunk/lib/country_codes.rb: fixed string encoding issue reported by ruby 1.9.2
Date: Fri, 22 Feb 2013 19:35:48 +0000 (UTC)

Revision
3441
Author
dgc
Date
2013-02-22 19:35:48 +0000 (Fri, 22 Feb 2013)

Log Message

fixed string encoding issue reported by ruby 1.9.2

Modified Paths

Diff

Modified: trunk/lib/country_codes.rb (3440 => 3441)


--- trunk/lib/country_codes.rb	2013-02-22 19:24:28 UTC (rev 3440)
+++ trunk/lib/country_codes.rb	2013-02-22 19:35:48 UTC (rev 3441)
@@ -1,7 +1,7 @@
 module CountryCodes
     @@codes = Hash.new
     File.open('config/countries.tab').each do |record|
-      parts = record.split("\t")
+      parts = record.force_encoding('iso-8859-1').split("\t")
       @@codes[parts[0]] = parts[1].strip
     end
     
@@ -25,4 +25,4 @@
     def self.valid_code?(code)
       @@codes.key?(code)
     end
-end
\ No newline at end of file
+end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]