[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CSV parsing and other issues (Re: LC_NUMERIC)

From: Eli Zaretskii
Subject: Re: CSV parsing and other issues (Re: LC_NUMERIC)
Date: Thu, 03 Jun 2021 18:01:03 +0300

> From: Maxim Nikulin <manikulin@gmail.com>
> Date: Thu, 3 Jun 2021 21:44:08 +0700
> Cc: Utkarsh Singh <utkarsh190601@gmail.com>
> So locale-aware number formatting would be a great improvement for 
> Emacs. On the other hand, it should be implemented with great care to 
> avoid localized numbers in some cases. Maybe locale argument should be 
> passed to functions that deal with numbers. Formatting of integer 
> numbers is not enough, floating point numbers should be handled as well. 
> Parsing numbers formatted accordingly to locale rules should be 
> addressed too. A function similar to `locale-info' is highly desired to 
> get properties of locale (e.g. decimal_point from result of localeconv). 
> Some decision is required whether calc & Co should operate with
> localized numbers.

Setting a locale globally in Emacs is a non-starter, for the reasons
that you point out and others.  Text processing in Emacs is generally
separate from the current locale's rules, mainly to have Emacs work
the same in any locale.  So passing a locale argument to functions
that produce output, with the intent to request some behavior to be
tailored to that locale, is the only reasonable way to have this kind
of functionalities in Emacs.  The problem with that, of course, is
that not every supported platform can dynamically change the locale,
let alone do that efficiently.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]