From a57661bb09e4344ecbeab2f8895b9abb255b95af Mon Sep 17 00:00:00 2001 From: sachoboo Date: Mon, 21 Jul 2014 21:11:36 +0900 Subject: [PATCH] Read icon data in binary mode. On Windows platform, File#read cannot read data beyond the 0x1A (treated as EOF) character from a file which is opened in text mode. --- lib/ruby_gntp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby_gntp.rb b/lib/ruby_gntp.rb index 12a9225..5a8af7f 100755 --- a/lib/ruby_gntp.rb +++ b/lib/ruby_gntp.rb @@ -268,7 +268,7 @@ def get_gntp_header_start(type) # def handle_icon(icon, type) if File.exists?(icon) && @target_host != 'localhost' - file = File.new(icon) + file = File.new(icon, 'rb') data = file.read size = data.length if size > 0