Re: Command line arguments depend on locale

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

 



On 2013-01-30, Benny Amorsen <benny+usenet@xxxxxxxxxx> wrote:
> Apparently ping has now started interpreting its command line arguments
> depending on locale. I.e. ping -i 0.1 no longer works in locales where
> comma is the decimal separator.
>
> This makes it difficult to call system commands. The only workaround is
> to set LC_ALL to a known-good locale, but then your users get no benefit
> from the translations of error messages and so on.
>
This is not easy problem. If you print localalized values, then there is
natural desire for symmetry. Hence locale specific arguments.

File name arguments: Two users use different codeset, both operates on
the same file system. They cannot cooperate without locale sensitive decoding.

There are many other scenerarion and it's generally accepted that
process arguments as well as other texts are locale specific.

I understand it makes your code more difficult but nobody says doing
things right is easy. (You still have to format float to string when
building execve() arguments. sprintf() respects locale. Just setlocale()
at the beginning of your main()).

-- Petr

-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux