common: New function print_utf9_string.

* common/miscellaneous.c (print_utf8_string): New.
--

This is a simple convenience function.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-07-20 17:20:17 +02:00
parent 33ecb541fc
commit bddc2e04f1
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 11 additions and 0 deletions

View File

@ -228,6 +228,16 @@ print_utf8_buffer (estream_t stream, const void *p, size_t n)
do_print_utf8_buffer (stream, p, n, NULL, NULL);
}
void
print_utf8_string (estream_t stream, const char *p)
{
if (!p)
p = "";
do_print_utf8_buffer (stream, p, strlen (p), NULL, NULL);
}
/* Write LENGTH bytes of BUFFER to FP as a hex encoded string.
RESERVED must be 0. */
void

View File

@ -302,6 +302,7 @@ void print_utf8_buffer3 (estream_t fp, const void *p, size_t n,
const char *delim);
void print_utf8_buffer2 (estream_t fp, const void *p, size_t n, int delim);
void print_utf8_buffer (estream_t fp, const void *p, size_t n);
void print_utf8_string (estream_t stream, const char *p);
void print_hexstring (FILE *fp, const void *buffer, size_t length,
int reserved);
char *try_make_printable_string (const void *p, size_t n, int delim);