mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Add new method for escaping UTF8 strings for JSON output
This commit is contained in:
parent
2cb87c3309
commit
385de9b0e7
2 changed files with 95 additions and 0 deletions
|
@ -565,4 +565,12 @@ std::unique_ptr<T> build_unique (Args&&... args) {
|
|||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes bytes in a string that are not valid UTF8 characters with \xYY format. Used
|
||||
* by the JSON writer and BIF methods.
|
||||
* @param val the input string to be escaped
|
||||
* @return the escaped string
|
||||
*/
|
||||
std::string json_escape_utf8(const std::string& val);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue