/*++ /* NAME /* quote_for_json 3 /* SUMMARY /* quote UTF-8 string value for JSON /* SYNOPSIS /* #include <quote_for_json.h> /* /* char *quote_for_json( /* VSTRING *result, /* const char *in, /* ssize_t len) /* /* char *quote_for_json_append( /* VSTRING *result, /* const char *in, /* ssize_t len) /* /* char *quote_for_json_var( /* VSTRING *result, /* const char *in) /* DESCRIPTION /* quote_for_json() takes well-formed UTF-8 encoded text, /* quotes that text compliant with RFC 4627, and returns a /* pointer to the resulting text. The input may contain null /* bytes, but the output will not. /* /* quote_for_json() produces short (two-letter) escape sequences /* for common control characters, double quote and backslash. /* It will not quote "/" (0x2F), and will quote DEL (0x7f) as /* \u007F to make it printable. The input byte sequence "\uXXXX" /* is quoted like any other text (the "\" is escaped as "\\"). /* /* quote_for_json() does not perform UTF-8 validation. The caller /* should use valid_utf8_string() or printable() as appropriate. /* /* quote_for_json_append() appends the output to the result buffer. /* /* quote_for_json_var() takes a null-terminated sequence of /* null-terminated arguments and formats them with quote_for_json(). * /* Arguments: /* .IP result /* Storage for the result, resized automatically. /* .IP in /* Pointer to the input byte sequence. /* .IP len /* The length of the input byte sequence, or a negative number /* when the byte sequence is null-terminated. /* DIAGNOSTICS /* Fatal error: memory allocation error. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA /* /* Wietse Venema /* porcupine.org
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.