- changed zstrformat to allow %c to emit non-ASCII characters as UTF-8.

This commit is contained in:
Christoph Oelckers 2019-02-19 00:27:47 +01:00
commit 91206f12be
2 changed files with 7 additions and 5 deletions

View file

@ -89,6 +89,7 @@
#include "zstring.h"
#include "gdtoa.h"
#include "utf8.h"
/*
@ -557,8 +558,11 @@ namespace StringFormat
else if (type == 'c')
{
intarg = va_arg (arglist, int);
buffer[0] = char(intarg);
bufflen = 1;
if (utf8_encode(intarg, (uint8_t*)buffer, &bufflen) != 0)
{
buffer[0] = '?';
bufflen = 1;
}
obuff = buffer;
}
else if (type == 's')