This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients eric.smith, mark.dickinson, mrabarnett, r.david.murray, skrah
Date 2009-12-02.10:42:03
SpamBayes Score 5.4126537e-11
Marked as misclassified No
Message-id <1259750527.03.0.634679225214.issue7327@psf.upfronthosting.co.za>
In-reply-to
Content
In python3.2, the output of decimal looks good. With float, the
separator is printed as two spaces on my Unicode terminal (export
LC_ALL=cs_CZ.UTF-8).

So decimal (3.2) interprets the separator string as a single UTF-8 char
and the final output is a UTF-8 string. I'd say that in C, this is the
intended way of using struct lconv.

If there is an agreement that the final output should be a UTF-8 string,
this looks correct to me.



Python 3.2a0 (py3k:76081M, Nov  6 2009, 15:23:48) 
[GCC 4.1.3 20080623 (prerelease) (Ubuntu 4.1.2-23ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale, decimal
>>> locale.setlocale(locale.LC_NUMERIC, 'cs_CZ.UTF-8')
'cs_CZ.UTF-8'
>>> x = format(decimal.Decimal("-1.5"),  '019.18n')
>>> y = format(float("-1.5"),  '019.18n')
>>> x
'-0\xa0000\xa0000\xa0000\xa0001,5'
>>> y
'-0ᅡᅠ000ᅡᅠ000ᅡᅠ001,5'
>>> print(x)
-0 000 000 000 001,5
>>> print(y)
-0ᅡᅠ000ᅡᅠ000ᅡᅠ001,5
>>>
History
Date User Action Args
2009-12-02 10:42:07skrahsetrecipients: + skrah, mark.dickinson, eric.smith, mrabarnett, r.david.murray
2009-12-02 10:42:07skrahsetmessageid: <1259750527.03.0.634679225214.issue7327@psf.upfronthosting.co.za>
2009-12-02 10:42:05skrahlinkissue7327 messages
2009-12-02 10:42:04skrahcreate