don't escape poop emoji (emit as utf8 instead)

if input is not valid utf8, encode each invalid byte as utf8 in output
This commit is contained in:
leitner
2018-02-02 18:16:09 +00:00
parent 112ccf19e7
commit 708e34ab7f
2 changed files with 15 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ size_t fmt_foldwhitespace(char* dest,const char* src,size_t len);
size_t fmt_ldapescape(char* dest,const char* src,size_t len);
size_t fmt_ldapescape2(char* dest,const char* src,size_t len,const char* escapeme);
/* Encode JSON string from UTF-8; will backslash-escape the bare minimum.
* Will not verify that the input is valid UTF-8!
* Invalid UTF-8 in input will output as valid UTF-8 for each byte
* Worst case: len*6 */
size_t fmt_jsonescape(char* dest,const char* src,size_t len);