X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fstr.c;h=44e4a1da28ee7183a98eb1e819a755bc55759c0f;hb=refs%2Fbuilds%2F20121225032008%2Fpspp;hp=79e9ea1e14dae1def667b3f4edd1ea60f4e0ac5d;hpb=c60b1277e785531b1cfc26b48697af7f942561d3;p=pspp diff --git a/src/libpspp/str.c b/src/libpspp/str.c index 79e9ea1e14..44e4a1da28 100644 --- a/src/libpspp/str.c +++ b/src/libpspp/str.c @@ -1548,6 +1548,13 @@ ds_put_byte_multiple (struct string *st, int ch, size_t cnt) memset (ds_put_uninit (st, cnt), ch, cnt); } +/* Appends Unicode code point UC to ST in UTF-8 encoding. */ +void +ds_put_unichar (struct string *st, ucs4_t uc) +{ + ds_extend (st, ds_length (st) + 6); + st->ss.length += u8_uctomb (CHAR_CAST (uint8_t *, ds_end (st)), uc, 6); +} /* If relocation has been enabled, replace ST, with its relocated version */