translating foreign data

Peter J. Holzer hjp-python at hjp.at
Sat Jun 23 14:12:31 EDT 2018


On 2018-06-23 12:41:33 -0400, Richard Damon wrote:
> On 6/23/18 11:44 AM, Steven D'Aprano wrote:
> > You're assuming that there will be a misinterpretation. That's an absurd 
> > assumption to make. There might be, of course, but the documentation for 
> > my document might be clear that comma is to be used for decimal 
> > separators. Or it might include numbers like
> >
> >     1.234.567,012345678
> >
> > which is understandable to anyone who is aware of the possibility that 
> > comma may mean decimal separator and period the thousands separator.
> >
> Then I shouldn't be using en-AU to decode the file.

Quite right, You shouldn't.

> Now, if I have a parser that doesn't use the locale, but some other rule
> base than I just need to provide it with the right rules, which is
> basically just defining the right locale.

Nope. The right rules for almost any file format are much more than the
locale.

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp at hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20180623/274a9216/attachment.sig>


More information about the Python-list mailing list