lib/encx.rb in encx-0.1.0 vs lib/encx.rb in encx-0.1.3
- old
+ new
@@ -44,12 +44,14 @@
end
hs
end
def compare(l , hs)
+ puts "# Call compare"
ret2 = @encoding_ary.find{ |x|
begin
+# p hs[x]
ret = hs[x].match(l)
if ret
ret = true
@re = hs[x]
@last_match = Regexp.last_match[1]
@@ -66,15 +68,15 @@
ret
}
ret2 != nil
end
-
+
def convert( d , enc = nil )
if enc
- d.encode( enc , {:undef=>:replace, :invalid=>:replace, :replace => ""})
+ d.encode( enc , **{:undef=>:replace, :invalid=>:replace, :replace => ""})
else
- d.encode( @encoding , {:undef=>:replace, :invalid=>:replace, :replace => ""})
+ d.encode( @encoding , **{:undef=>:replace, :invalid=>:replace, :replace => ""})
end
end
def conv_env_sub( d , enc = nil )
val = nil