Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18051 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57570 invoked by uid 1010); 14 Aug 2005 13:35:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57554 invoked from network); 14 Aug 2005 13:35:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2005 13:35:09 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:47813] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 96/50-33075-B884FF24 for ; Sun, 14 Aug 2005 09:35:07 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j7EDZ3T6006035 for ; Sun, 14 Aug 2005 15:35:03 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j7EDYvBt006022; Sun, 14 Aug 2005 15:34:58 +0200 Date: Sun, 14 Aug 2005 15:34:55 +0200 (CEST) X-X-Sender: derick@localhost To: Andrei Zmievski cc: PHP Developers Mailing List Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdi-ict.nl Subject: snprintf + unicode From: derick@php.net (Derick Rethans) 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