snprintf + unicode
| From: | Derick Rethans | Date: | Sun, 14 Aug 2005 13:34:55 +0000 |
| Subject: | snprintf + unicode | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-18051@lists.php.net to get a copy of this message | ||
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