X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fstr.c;h=d7c71b11f5509f15678693555676c54cc4662e3f;hb=refs%2Fbuilds%2F20131001030504%2Fpspp;hp=cde0db9ae091a6493f8f8cb2238f9fec0c308b0e;hpb=8539c057c6889ff335da0e00117cc0f5fb9bf72d;p=pspp diff --git a/src/libpspp/str.c b/src/libpspp/str.c index cde0db9ae0..d7c71b11f5 100644 --- a/src/libpspp/str.c +++ b/src/libpspp/str.c @@ -1593,6 +1593,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 */