mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 07:07:54 -04:00
parent
6d56067f73
commit
c4a6f41ca6
2 changed files with 5 additions and 0 deletions
|
@ -117,6 +117,10 @@ module LogStash
|
||||||
@jruby ||= !!(RUBY_PLATFORM == "java")
|
@jruby ||= !!(RUBY_PLATFORM == "java")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def windows?
|
||||||
|
Gem.win_platform?
|
||||||
|
end
|
||||||
|
|
||||||
def vendor_path(path)
|
def vendor_path(path)
|
||||||
return ::File.join(LOGSTASH_HOME, "vendor", path)
|
return ::File.join(LOGSTASH_HOME, "vendor", path)
|
||||||
end
|
end
|
||||||
|
|
|
@ -296,6 +296,7 @@ class LogStash::Event
|
||||||
def self.validate_value(value)
|
def self.validate_value(value)
|
||||||
case value
|
case value
|
||||||
when String
|
when String
|
||||||
|
value.force_encoding("UTF-8") if LogStash::Environment.windows?
|
||||||
raise("expected UTF-8 encoding for value=#{value}, encoding=#{value.encoding.inspect}") unless value.encoding == Encoding::UTF_8
|
raise("expected UTF-8 encoding for value=#{value}, encoding=#{value.encoding.inspect}") unless value.encoding == Encoding::UTF_8
|
||||||
raise("invalid UTF-8 encoding for value=#{value}, encoding=#{value.encoding.inspect}") unless value.valid_encoding?
|
raise("invalid UTF-8 encoding for value=#{value}, encoding=#{value.encoding.inspect}") unless value.valid_encoding?
|
||||||
value
|
value
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue