From 0c802ea3e1544e1783ca9a7bafd30343f36214bb Mon Sep 17 00:00:00 2001 From: HD Moore Date: Wed, 30 Sep 2009 03:25:39 +0000 Subject: [PATCH] Fixes #345. Adds a more stringent check for ::Encoding class being defined, should work around false positives with getbyte git-svn-id: file:///home/svn/framework3/trunk@7095 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rbreadline.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbreadline.rb b/lib/rbreadline.rb index b96cee5c79..a4dd79099f 100644 --- a/lib/rbreadline.rb +++ b/lib/rbreadline.rb @@ -4428,7 +4428,7 @@ module RbReadline end end - if defined? ''.getbyte + if(Object.const_defined?('Encoding') and Encoding.respond_to?('default_external')) @encoding = "X" # ruby 1.9.x or greater @encoding_name = Encoding.default_external.to_s end