ruby-changes:22556
From: naruse <ko1@a...>
Date: Wed, 15 Feb 2012 05:13:37 +0900 (JST)
Subject: [ruby-changes:22556] naruse:r34605 (trunk): Set encoding as ASCII-8BIT. [Bug #6027]
naruse 2012-02-15 05:13:27 +0900 (Wed, 15 Feb 2012) New Revision: 34605 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34605 Log: Set encoding as ASCII-8BIT. [Bug #6027] Modified files: trunk/test/ruby/memory_status.rb Index: test/ruby/memory_status.rb =================================================================== --- test/ruby/memory_status.rb (revision 34604) +++ test/ruby/memory_status.rb (revision 34605) @@ -7,7 +7,7 @@ PROC_FILE = procfile VM_PAT = /^Vm(\w+):\s+(\d+)/ def self.read_status - IO.foreach(PROC_FILE) do |l| + IO.foreach(PROC_FILE, encoding: Encoding::ASCII_8BIT) do |l| yield($1.downcase.intern, $2.to_i * 1024) if VM_PAT =~ l end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/