You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Escapes slash, double quotes, and newlines in [s] with \ as needed
36
+
/// for a TextFormat string.
37
+
///
38
+
/// This is a copy of the official Java implementation: https://github.com/protocolbuffers/protobuf/blob/main/java/core/src/main/java/com/google/protobuf/TextFormat.java#L632
39
+
StringescapeString(String s) {
40
+
return s
41
+
.replaceAll('\\', '\\\\')
42
+
.replaceAll('"', '\\"')
43
+
.replaceAll('\n', '\\n');
44
+
}
45
+
46
+
/// Appends the characters of [bytes] to [out] while escaping them as needed
47
+
/// for a TextFormat string.
48
+
///
49
+
/// See TextFormat spec in https://protobuf.dev/reference/protobuf/textformat-spec/
50
+
/// This is a copy of the official Java implementation: https://github.com/protocolbuffers/protobuf/blob/main/java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java#L40
0 commit comments