Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18083 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55537 invoked by uid 1010); 15 Aug 2005 03:14:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55522 invoked from network); 15 Aug 2005 03:14:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2005 03:14:56 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:59796] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 44/7E-33075-EA800034 for ; Sun, 14 Aug 2005 23:14:55 -0400 Received: from [192.168.11.2] (c-24-6-96-18.hsd1.ca.comcast.net [24.6.96.18]) (authenticated bits=0) by colo.lerdorf.com (8.13.4/8.13.4/Debian-3) with ESMTP id j7F3EqVr030726; Sun, 14 Aug 2005 20:14:52 -0700 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: Andrei Zmievski , PHP Developers Mailing List Content-Transfer-Encoding: 7bit Date: Sun, 14 Aug 2005 20:15:16 -0700 To: Derick Rethans X-Mailer: Apple Mail (2.733) Subject: Re: snprintf + unicode From: andrei@gravitonic.com (Andrei Zmievski) http://icu.sourceforge.net/apiref/icu4c/ustdio_8h.html#a36 -Andrei On Aug 14, 2005, at 6:34 AM, Derick Rethans wrote: > 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 >