snprintf + unicode

php.internals

Derick Rethans

21 years ago
Hei, currently I've the following [pseudo] code: c = ""; a = snprintf(buffer, 32, "%0d", day); b = snprintf(buffer, 32, "%s", daynames[dayofweek]); smartstr_appends(&c, a); smartstr_appends(&c, b); return c.c; This snippet of code returns a legacy string. Now, as ICU provides the daynames as UTF16 encoded strings, I'm a bit lost as how to solve this. Of course I need to return a UNICODE string now, but which snprintf() like function should I use, so that %0d and friends are printed into the string as UTF16 string which I then can concat together, and return from the function? Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

Andrei Zmievski

21 years ago
http://icu.sourceforge.net/apiref/icu4c/ustdio_8h.html#a36 -Andrei On Aug 14, 2005, at 6:34 AM, Derick Rethans wrote: