[Bug 49496] New: sprintf uses locale specific decimal point when it should not.

WineHQ Bugzilla wine-bugs at winehq.org
Wed Jul 1 11:04:12 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=49496

            Bug ID: 49496
           Summary: sprintf uses locale specific decimal point when it
                    should not.
           Product: Wine
           Version: 5.11
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: bernhardu at mailbox.org
      Distribution: ---

This manifested first in Microsoft Word 2007 printing
empty pages with wine-5.11.
I could track this down to wineeps.drv using
my locales "de_DE.UTF-8" decimalpoint ','
instead of the expected '.' from the "C" locale:

   - /FontBBox [-0.476074 -0.193848 1.213867 0.952148] def
   + /FontBBox [-0,476074 -0,193848 1,213867 0,952148] def

This line is produced in wineps.drv\type42.c:207, which is surrounded
by setlocale calls to use "C". But these do call into MSVCRT_setlocale,
which seems not forward this into glibc. And in the end the "%f" format
is forwarded to glibc's __sprintf.


A git bisect led to this commit:

    b86dc3926bfe5cd92400aa96c89b0255eba1d447 is the first bad commit
    commit b86dc3926bfe5cd92400aa96c89b0255eba1d447
    Author: Alexandre Julliard <julliard at winehq.org>
    Date:   Thu Jun 11 11:38:16 2020 +0200

        ntdll: Move the locales initialization to the Unix library.

        Signed-off-by: Alexandre Julliard <julliard at winehq.org>


This, I guess, is also visible in the tests of ucrtbase:printf since
that day, where some machines seem to use french locale:

    https://test.winehq.org/data/tests/ucrtbase:printf.html

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list