Re: Issue 85 in tovid: tovid todisc line 454 printf 1.2345 invalid number

18 views
Skip to first unread message

grepper

unread,
Mar 12, 2013, 12:37:46 AM3/12/13
to tovid...@googlegroups.com
On 11/03/13 11:28 PM, to...@googlecode.com wrote:

> Comment #15 on issue 85 by captblasteroid: tovid todisc line 454 printf
> 1.2345 invalid number
> http://code.google.com/p/tovid/issues/detail?id=85
>
> In the Mandriva Forum it was reported that "LC_NUMERIC=C" works, but I
> don't test it yet. I cannot do it now, but I will in a day or two.
> I have a question: if you change LC_NUMERIC at the beginning of bc_math
> (or at the beginning of todisc), how do you restore the value it had
> before running todisc script?
> In my system LC_NUMERIC contains "es_AR.UTF-8" (without quotation
> marks). If I add "LC_NUMERIC=C", the es_AR value is lost. So, how do I
> recover it? Ok, I know that I can run "LC_NUMERIC=es_AR.UTF-8" after
> finishing with tovid. But I'm trying to have a solution that it's more
> "universal", in the sense that it can be used if your LC_NUMERIC is
> en_GB, mine is es_AR or other one have fr_FR or so. My idea is to make
> tovid/todisc independent of the LC_NUMERIC value, and LC_NUMERIC (or any
> other "system variable") not altered because of the execution of
> tovid/todisc.
> Please take into account that I'm not a bash expert at all. Maybe your
> solution change the value of LC_NUMERIC only "locally" (i.e., its value
> change only while the todisc script is running, but it recover its
> original value when the script ends). I cannot test "LC_NUMERIC=C" yet,
> but when I will, I'll find out if LC_NUMERIC is altered or not (I'm
> pretty sure that tovid will run OK and the DVD it will be created after
> modifying bc_math with your or mine solution).
Hi,
Thanks for agreeing to test. It is difficult for me to do so as I have
only English language locales installed, and I have little experience
with other locales. Though of course I did generate some other locales
and did a test of the above function.

As far as your question is concerned: a child process (in this case
todisc) can not affect the environment of its parent, so your LC_NUMERIC
will be unchanged when the script exits. In addition, I planned to make
the assignment local to the function ("local LC_NUMERIC"), so it will
not even affect other parts of the script which will still run with your
systems LC_NUMERIC. If that is not what you want, it can be exported at
the top of the script to affect it globally.

To be honest I am surprised that todisc works with other locales - how
does the output with a period from printf now play with programs that
expect a comma, like for example time codes given to mplayer or ffmpeg ?
As you can see, I am pretty foggy about these issues.

all the best,
grepper

Reply all
Reply to author
Forward
0 new messages