Class: ENV

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/patches/bugfix_jruby_2558.rb

Overview

make sure all strings pulled out of ENV are UTF8

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/logstash/patches/bugfix_jruby_2558.rb', line 41

def [](key)
  case value = orig_getter(key)
  when String
    # dup is necessary since force_encoding is destructive
    value.dup.force_encoding(Encoding::UTF_8)
  else
    value
  end
end

.orig_getterObject



40
# File 'lib/logstash/patches/bugfix_jruby_2558.rb', line 40

alias_method :orig_getter, :[]