X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Wed, 27 Aug 2008 15:54:09 +0200 From: "Amaury Forgeot d'Arc" To: cygwin AT cygwin DOT com Subject: printf: %ls or %S does not work when string is of length 1. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hello, it seems that cygwin does not correctly handle the %ls format when the given string has only one character. The following program should print Test 1 (T) and that's what it does on Linux 64bit and Windows, when compiled with VS8.0 But cygwin's output is Test 1 I've seen this only for 1-wchar strings. This is will be a problem with the upcoming python 3.0 interpreter, as reported here: http://bugs.python.org/issue3626 Is there a problem with cygwin's implementation, or did I miss something obvious? /* ======================================== */ #include int main() { wchar_t text[] = L"T"; printf("Test %d (%ls)\n", wcslen(text), text); } /* ======================================== */ -- Amaury Forgeot d'Arc -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/