#include "base/json/string_escape.h"
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include <string>
#include <string_view>
#include "base/check_op.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
#include "base/third_party/icu/icu_utf.h"
namespace base {
namespace {
const char kU16EscapeFormat[] = …;
const base_icu::UChar32 kReplacementCodePoint = …;
static_assert …;
bool EscapeSpecialCodePoint(base_icu::UChar32 code_point, std::string* dest) { … }
template <typename S>
bool EscapeJSONStringImpl(const S& str, bool put_in_quotes, std::string* dest) { … }
}
bool EscapeJSONString(std::string_view str,
bool put_in_quotes,
std::string* dest) { … }
bool EscapeJSONString(std::u16string_view str,
bool put_in_quotes,
std::string* dest) { … }
std::string GetQuotedJSONString(std::string_view str) { … }
std::string GetQuotedJSONString(std::u16string_view str) { … }
std::string EscapeBytesAsInvalidJSONString(std::string_view str,
bool put_in_quotes) { … }
}