class InfluxDB::PointValue

def escape(str, type)

def escape(str, type)
  # rubocop:disable Layout/AlignParameters
  str = str.encode "UTF-8".freeze, "UTF-8".freeze,
    invalid: :replace,
    undef: :replace,
    replace: "".freeze
  # rubocop:enable Layout/AlignParameters
  ESCAPES[type].each do |ch|
    str = str.gsub(ch) { "\\#{ch}" }
  end
  str
end