printf: %ls or %S does not work when string is of length 1.

Roger Wells ROGER.K.WELLS@saic.com
Wed Aug 27 18:56:00 GMT 2008


Amaury Forgeot d'Arc wrote:
> 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
>   
The output is also correct on Windows when built with MinGW gcc v3.4.5
roger wells


> 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 <stdio.h>
> 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/
>
>
>   

-- 
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@saic.com


--
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/



More information about the Cygwin mailing list