Sha256: fc129cabdfeb2a1fd2b5d46d0e5f82f2e216b0ce56fa1ce9f853a187871af403

Contents?: true

Size: 351 Bytes

Versions: 3

Compression:

Stored size: 351 Bytes

Contents

if RUBY_VERSION < '1.9'

  class String
    def utf8!
      self
    end
  
    def binary!
      self
    end
  end

else 

  class String
    def utf8!
      self.force_encoding('utf-8')
    end
    
    def binary!
      self.force_encoding('binary')
    end
  end
  
end

class NilClass
  def utf8!
    self
  end

  def binary!
    self
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encoding-kawai-0.5 lib/encoding-kawai.rb
encoding-kawai-0.4 lib/encoding-kawai.rb
encoding-kawai-0.3 lib/encoding-kawai.rb