# File lib/fluent/compat/string_util.rb, line 20 def match_regexp(regexp, string) begin return regexp.match(string) rescue ArgumentError => e raise e unless e.message.index("invalid byte sequence in".freeze).zero? $log.info "invalid byte sequence is replaced in `#{string}`" string = string.scrub('?') retry end return true end
# File lib/fluent/compat/string_util.rb, line 20 def match_regexp(regexp, string) begin return regexp.match(string) rescue ArgumentError => e raise e unless e.message.index("invalid byte sequence in".freeze).zero? $log.info "invalid byte sequence is replaced in `#{string}`" string = string.scrub('?') retry end return true end