Following up on shell(locale) problem

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Following up on shell(locale) problem

Peter Haworth-2
Hoping someone might come up with some help.  To recap, if I execute the command

locale -k LC_NUMERIC

...from Terminal on my Mac, the output is

decimal_point="."
thousands_sep=","
grouping="3;3"

However, if I use the LC Shell command to issue the same command and put the output into a field, it gives me:

decimal_point="."
thousands_sep=
grouping="0"

The thousands_sep and grouping lines don't show the correct info.

I have also tried using the shell command to issue "locale -k LC_NUMERIC > myFile.txt", then accessed myFile.txt with the put url command and used open/read to get the contents, but still the same result. The file looks fine when opened in TextEdit.  I can even copy and paste from TextEdit to the LC field and it looks fine.

I'm really hoping not, but this is feeling like a bug.

Any thoughts?

Pete Haworth


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Jeffrey Massung
It's possible that when you launch Terminal.app you are using BASH and that
LC is using SH (or something other than BASH) that doesn't have the
localization environment setup the same?

That's just a guess.

Jeff M.

On Tue, Mar 1, 2011 at 2:00 PM, Peter Haworth <[hidden email]>wrote:

> Hoping someone might come up with some help.  To recap, if I execute the
> command
>
> locale -k LC_NUMERIC
>
> ...from Terminal on my Mac, the output is
>
> decimal_point="."
> thousands_sep=","
> grouping="3;3"
>
> However, if I use the LC Shell command to issue the same command and put
> the output into a field, it gives me:
>
> decimal_point="."
> thousands_sep=
> grouping="0"
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
Thanks Jeff.  I tried setting the shellCommand property to point to bash but still the same problem.

Pete Haworth








http://www.mollysrevenge.com
http://www.sonicbids.com/MollysRevenge
http://www.myspace.com/mollysrevengeband








On Mar 1, 2011, at 1:13 PM, Jeff Massung wrote:

> It's possible that when you launch Terminal.app you are using BASH and that
> LC is using SH (or something other than BASH) that doesn't have the
> localization environment setup the same?
>
> That's just a guess.
>
> Jeff M.
>
> On Tue, Mar 1, 2011 at 2:00 PM, Peter Haworth <[hidden email]>wrote:
>
>> Hoping someone might come up with some help.  To recap, if I execute the
>> command
>>
>> locale -k LC_NUMERIC
>>
>> ...from Terminal on my Mac, the output is
>>
>> decimal_point="."
>> thousands_sep=","
>> grouping="3;3"
>>
>> However, if I use the LC Shell command to issue the same command and put
>> the output into a field, it gives me:
>>
>> decimal_point="."
>> thousands_sep=
>> grouping="0"
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

François Chaplais-3
In reply to this post by Peter Haworth-2
the LC shell command launches a shell which not the same as the one in Terminal. I am unfortunately not a Unix guru, but I know this has consequences on some "default" options, even if you use the same variant of the shell (BASH, I believe).
Le 1 mars 2011 à 22:00, Peter Haworth a écrit :

> Hoping someone might come up with some help.  To recap, if I execute the command
>
> locale -k LC_NUMERIC
>
> ...from Terminal on my Mac, the output is
>
> decimal_point="."
> thousands_sep=","
> grouping="3;3"
>
> However, if I use the LC Shell command to issue the same command and put the output into a field, it gives me:
>
> decimal_point="."
> thousands_sep=
> grouping="0"
>
> The thousands_sep and grouping lines don't show the correct info.
>
> I have also tried using the shell command to issue "locale -k LC_NUMERIC > myFile.txt", then accessed myFile.txt with the put url command and used open/read to get the contents, but still the same result. The file looks fine when opened in TextEdit.  I can even copy and paste from TextEdit to the LC field and it looks fine.
>
> I'm really hoping not, but this is feeling like a bug.
>
> Any thoughts?
>
> Pete Haworth
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
In reply to this post by Jeffrey Massung
Hey Jeff,
I also tried using the Bourne shell in Temrinal (the dictionary says that's what LC uses by default), and I got the same results as with bash.  I wish it had been that simple!

Pete Haworth

On Mar 1, 2011, at 1:13 PM, Jeff Massung wrote:

> It's possible that when you launch Terminal.app you are using BASH and that
> LC is using SH (or something other than BASH) that doesn't have the
> localization environment setup the same?
>
> That's just a guess.
>
> Jeff M.
>
> On Tue, Mar 1, 2011 at 2:00 PM, Peter Haworth <[hidden email]>wrote:
>
>> Hoping someone might come up with some help.  To recap, if I execute the
>> command
>>
>> locale -k LC_NUMERIC
>>
>> ...from Terminal on my Mac, the output is
>>
>> decimal_point="."
>> thousands_sep=","
>> grouping="3;3"
>>
>> However, if I use the LC Shell command to issue the same command and put
>> the output into a field, it gives me:
>>
>> decimal_point="."
>> thousands_sep=
>> grouping="0"
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Warren Samples
In reply to this post by Peter Haworth-2
On Tue, 2011-03-01 at 13:00 -0800, Peter Haworth wrote:

> Hoping someone might come up with some help.  To recap, if I execute the command
>
> locale -k LC_NUMERIC
>
> ...from Terminal on my Mac, the output is
>
> decimal_point="."
> thousands_sep=","
> grouping="3;3"
>
> However, if I use the LC Shell command to issue the same command and put the output into a field, it gives me:
>
> decimal_point="."
> thousands_sep=
> grouping="0"
>
> The thousands_sep and grouping lines don't show the correct info.
>
> I have also tried using the shell command to issue "locale -k LC_NUMERIC > myFile.txt", then accessed myFile.txt with the put url command and used open/read to get the contents, but still the same result. The file looks fine when opened in TextEdit.  I can even copy and paste from TextEdit to the LC field and it looks fine.
>
> I'm really hoping not, but this is feeling like a bug.
>
> Any thoughts?
>
> Pete Haworth
>
>


Hi Peter,

Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns the
same (expected) result for me here, running Linux, as I get in a
terminal. Same for putting the result into a field. I do get the same
unexpected behavior as you under OS X, however. I know this doesn't help
you solve you problem, but at may help isolate whatever bug it is that's
causing it.

Good Luck,

Warren






_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
In reply to this post by François Chaplais-3
Thanks Francois.  I don;t think that's the problem though.  If I use the LC shell command to execute the locale command and put it's output into a file, the contents of the file are correct.  BUt then if I open the file in LC and put the contents into a field, it's garbled again.

I wonder if there are some strange hidden characters in the output that are confusing LC?

Pete Haworth

On Mar 1, 2011, at 1:36 PM, François Chaplais wrote:

> the LC shell command launches a shell which not the same as the one in Terminal. I am unfortunately not a Unix guru, but I know this has consequences on some "default" options, even if you use the same variant of the shell (BASH, I believe).
> Le 1 mars 2011 à 22:00, Peter Haworth a écrit :
>
>> Hoping someone might come up with some help.  To recap, if I execute the command
>>
>> locale -k LC_NUMERIC
>>
>> ...from Terminal on my Mac, the output is
>>
>> decimal_point="."
>> thousands_sep=","
>> grouping="3;3"
>>
>> However, if I use the LC Shell command to issue the same command and put the output into a field, it gives me:
>>
>> decimal_point="."
>> thousands_sep=
>> grouping="0"
>>
>> The thousands_sep and grouping lines don't show the correct info.
>>
>> I have also tried using the shell command to issue "locale -k LC_NUMERIC > myFile.txt", then accessed myFile.txt with the put url command and used open/read to get the contents, but still the same result. The file looks fine when opened in TextEdit.  I can even copy and paste from TextEdit to the LC field and it looks fine.
>>
>> I'm really hoping not, but this is feeling like a bug.
>>
>> Any thoughts?
>>
>> Pete Haworth
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
In reply to this post by Warren Samples
Thanks Warren.  I just used the message box on my Mac and got the same (incorrect) output too.  It's good to know if works under Linux though because that makes me think it's an LC bug even more.

I'm currently researching if there's a way to get this info using Applescript (without issuing a shell command I mean) as a means to work around the problem.

Pete Haworth

On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:

> Hi Peter,
>
> Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns the
> same (expected) result for me here, running Linux, as I get in a
> terminal. Same for putting the result into a field. I do get the same
> unexpected behavior as you under OS X, however. I know this doesn't help
> you solve you problem, but at may help isolate whatever bug it is that's
> causing it.
>
> Good Luck,
>
> Warren


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
If theres a .bashrc file, or .. well I forget what its name is supposed to
be, you might try

shell("source path/to/my/.bashrc; locale -k LC_NUMERIC")

Basically, find the file that bash loads, source it to force to be
processed, and then tack your command onto the end.

On Tue, Mar 1, 2011 at 2:54 PM, Peter Haworth <[hidden email]>wrote:

> Thanks Warren.  I just used the message box on my Mac and got the same
> (incorrect) output too.  It's good to know if works under Linux though
> because that makes me think it's an LC bug even more.
>
> I'm currently researching if there's a way to get this info using
> Applescript (without issuing a shell command I mean) as a means to work
> around the problem.
>
> Pete Haworth
>
> On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:
>
> > Hi Peter,
> >
> > Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns the
> > same (expected) result for me here, running Linux, as I get in a
> > terminal. Same for putting the result into a field. I do get the same
> > unexpected behavior as you under OS X, however. I know this doesn't help
> > you solve you problem, but at may help isolate whatever bug it is that's
> > causing it.
> >
> > Good Luck,
> >
> > Warren
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
oh. If lc uses sh not bash, might need to parse whatever the default shell
resource file is for the LANG string, at which point you could manually set
it before calling locale. I don't recall if sh and bash are similar enough
to eat the same file.

On Tue, Mar 1, 2011 at 3:10 PM, Mike Bonner <[hidden email]> wrote:

> If theres a .bashrc file, or .. well I forget what its name is supposed to
> be, you might try
>
> shell("source path/to/my/.bashrc; locale -k LC_NUMERIC")
>
> Basically, find the file that bash loads, source it to force to be
> processed, and then tack your command onto the end.
>
> On Tue, Mar 1, 2011 at 2:54 PM, Peter Haworth <[hidden email]>wrote:
>
>> Thanks Warren.  I just used the message box on my Mac and got the same
>> (incorrect) output too.  It's good to know if works under Linux though
>> because that makes me think it's an LC bug even more.
>>
>> I'm currently researching if there's a way to get this info using
>> Applescript (without issuing a shell command I mean) as a means to work
>> around the problem.
>>
>> Pete Haworth
>>
>> On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:
>>
>> > Hi Peter,
>> >
>> > Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns the
>> > same (expected) result for me here, running Linux, as I get in a
>> > terminal. Same for putting the result into a field. I do get the same
>> > unexpected behavior as you under OS X, however. I know this doesn't help
>> > you solve you problem, but at may help isolate whatever bug it is that's
>> > causing it.
>> >
>> > Good Luck,
>> >
>> > Warren
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Warren Samples
On Tue, 2011-03-01 at 15:13 -0700, Mike Bonner wrote:

> oh. If lc uses sh not bash, might need to parse whatever the default shell
> resource file is for the LANG string, at which point you could manually set
> it before calling locale. I don't recall if sh and bash are similar enough
> to eat the same file.
>
> On Tue, Mar 1, 2011 at 3:10 PM, Mike Bonner <[hidden email]> wrote:
>
> > If theres a .bashrc file, or .. well I forget what its name is supposed to
> > be, you might try
> >
> > shell("source path/to/my/.bashrc; locale -k LC_NUMERIC")
> >
> > Basically, find the file that bash loads, source it to force to be
> > processed, and then tack your command onto the end.
> >
> > On Tue, Mar 1, 2011 at 2:54 PM, Peter Haworth <[hidden email]>wrote:
> >
> >> Thanks Warren.  I just used the message box on my Mac and got the same
> >> (incorrect) output too.  It's good to know if works under Linux though
> >> because that makes me think it's an LC bug even more.
> >>
> >> I'm currently researching if there's a way to get this info using
> >> Applescript (without issuing a shell command I mean) as a means to work
> >> around the problem.
> >>
> >> Pete Haworth
> >>
> >> On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:
> >>
> >> > Hi Peter,
> >> >
> >> > Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns the
> >> > same (expected) result for me here, running Linux, as I get in a
> >> > terminal. Same for putting the result into a field. I do get the same
> >> > unexpected behavior as you under OS X, however. I know this doesn't help
> >> > you solve you problem, but at may help isolate whatever bug it is that's
> >> > causing it.
> >> >
> >> > Good Luck,
> >> >
> >> > Warren
> >>
> >>

Hello,

"Which shell" doesn't seem to be the problem. 'locale' returns the same
result regardless of the shell it's called from. Tried it in 'csh',
'zsh', 'bash' and sh. 'sh' and '/bin/sh' seem to just be aliases for
bash under OS X, at any rate. Is that not correct?

Warren



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
Ah k, hadn't seen this one..

*Thanks Francois.  I don;t think that's the problem though.  If I use the LC
shell command to execute the locale command and put it's output into a file,
the contents of the file are correct.  BUt then if I open the file in LC and
put the contents into a field, it's garbled again.*


I'd still be curious to know if
env; |grep LANG

returns the same environment variable value both from LC shell, and from
terminal, but no clue why reading in the file output from locale would cause
it to go funky.


On Tue, Mar 1, 2011 at 3:26 PM, Warren Samples <[hidden email]> wrote:

> On Tue, 2011-03-01 at 15:13 -0700, Mike Bonner wrote:
> > oh. If lc uses sh not bash, might need to parse whatever the default
> shell
> > resource file is for the LANG string, at which point you could manually
> set
> > it before calling locale. I don't recall if sh and bash are similar
> enough
> > to eat the same file.
> >
> > On Tue, Mar 1, 2011 at 3:10 PM, Mike Bonner <[hidden email]> wrote:
> >
> > > If theres a .bashrc file, or .. well I forget what its name is supposed
> to
> > > be, you might try
> > >
> > > shell("source path/to/my/.bashrc; locale -k LC_NUMERIC")
> > >
> > > Basically, find the file that bash loads, source it to force to be
> > > processed, and then tack your command onto the end.
> > >
> > > On Tue, Mar 1, 2011 at 2:54 PM, Peter Haworth <[hidden email]
> >wrote:
> > >
> > >> Thanks Warren.  I just used the message box on my Mac and got the same
> > >> (incorrect) output too.  It's good to know if works under Linux though
> > >> because that makes me think it's an LC bug even more.
> > >>
> > >> I'm currently researching if there's a way to get this info using
> > >> Applescript (without issuing a shell command I mean) as a means to
> work
> > >> around the problem.
> > >>
> > >> Pete Haworth
> > >>
> > >> On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:
> > >>
> > >> > Hi Peter,
> > >> >
> > >> > Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns
> the
> > >> > same (expected) result for me here, running Linux, as I get in a
> > >> > terminal. Same for putting the result into a field. I do get the
> same
> > >> > unexpected behavior as you under OS X, however. I know this doesn't
> help
> > >> > you solve you problem, but at may help isolate whatever bug it is
> that's
> > >> > causing it.
> > >> >
> > >> > Good Luck,
> > >> >
> > >> > Warren
> > >>
> > >>
>
> Hello,
>
> "Which shell" doesn't seem to be the problem. 'locale' returns the same
> result regardless of the shell it's called from. Tried it in 'csh',
> 'zsh', 'bash' and sh. 'sh' and '/bin/sh' seem to just be aliases for
> bash under OS X, at any rate. Is that not correct?
>
> Warren
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell command, it returns nothing!!  There's definitely something weird going on with the LC shell command.

Pete Haworth

On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:

> I'd still be curious to know if
> env; |grep LANG
>
> returns the same environment variable value both from LC shell, and from
> terminal


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
In reply to this post by Mike Bonner
Ok, the plot thickens!  I ran a simple Applescript from the Applescript editor:

do shell script ("locale -k LC_MONETARY")

and got the same problem!

Pete Haworth

On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:

> Ah k, hadn't seen this one..
>
> *Thanks Francois.  I don;t think that's the problem though.  If I use the LC
> shell command to execute the locale command and put it's output into a file,
> the contents of the file are correct.  BUt then if I open the file in LC and
> put the contents into a field, it's garbled again.*
>
>
> I'd still be curious to know if
> env; |grep LANG
>
> returns the same environment variable value both from LC shell, and from
> terminal, but no clue why reading in the file output from locale would cause
> it to go funky.
>
>
> On Tue, Mar 1, 2011 at 3:26 PM, Warren Samples <[hidden email]> wrote:
>
>> On Tue, 2011-03-01 at 15:13 -0700, Mike Bonner wrote:
>>> oh. If lc uses sh not bash, might need to parse whatever the default
>> shell
>>> resource file is for the LANG string, at which point you could manually
>> set
>>> it before calling locale. I don't recall if sh and bash are similar
>> enough
>>> to eat the same file.
>>>
>>> On Tue, Mar 1, 2011 at 3:10 PM, Mike Bonner <[hidden email]> wrote:
>>>
>>>> If theres a .bashrc file, or .. well I forget what its name is supposed
>> to
>>>> be, you might try
>>>>
>>>> shell("source path/to/my/.bashrc; locale -k LC_NUMERIC")
>>>>
>>>> Basically, find the file that bash loads, source it to force to be
>>>> processed, and then tack your command onto the end.
>>>>
>>>> On Tue, Mar 1, 2011 at 2:54 PM, Peter Haworth <[hidden email]
>>> wrote:
>>>>
>>>>> Thanks Warren.  I just used the message box on my Mac and got the same
>>>>> (incorrect) output too.  It's good to know if works under Linux though
>>>>> because that makes me think it's an LC bug even more.
>>>>>
>>>>> I'm currently researching if there's a way to get this info using
>>>>> Applescript (without issuing a shell command I mean) as a means to
>> work
>>>>> around the problem.
>>>>>
>>>>> Pete Haworth
>>>>>
>>>>> On Mar 1, 2011, at 1:42 PM, Warren Samples wrote:
>>>>>
>>>>>> Hi Peter,
>>>>>>
>>>>>> Doing 'put shell("locale -k LC_NUMERIC")' in the message box returns
>> the
>>>>>> same (expected) result for me here, running Linux, as I get in a
>>>>>> terminal. Same for putting the result into a field. I do get the
>> same
>>>>>> unexpected behavior as you under OS X, however. I know this doesn't
>> help
>>>>>> you solve you problem, but at may help isolate whatever bug it is
>> that's
>>>>>> causing it.
>>>>>>
>>>>>> Good Luck,
>>>>>>
>>>>>> Warren
>>>>>
>>>>>
>>
>> Hello,
>>
>> "Which shell" doesn't seem to be the problem. 'locale' returns the same
>> result regardless of the shell it's called from. Tried it in 'csh',
>> 'zsh', 'bash' and sh. 'sh' and '/bin/sh' seem to just be aliases for
>> bash under OS X, at any rate. Is that not correct?
>>
>> Warren
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
In reply to this post by Peter Haworth-2
Ok, while this doesn't solve the issue, if you do

shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")

You get back the correct info yes?

The problem here is that (I think someone said this farther up) the process
shell uses isn't the same as a full blown terminal start. If you have a
.bash_profile file in your user directory, and you do

shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?

On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]>wrote:

> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
> command, it returns nothing!!  There's definitely something weird going on
> with the LC shell command.
>
> Pete Haworth
>
> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
>
> > I'd still be curious to know if
> > env; |grep LANG
> >
> > returns the same environment variable value both from LC shell, and from
> > terminal
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
Oh. And since it's UTF-8, and it looks correct in the file apparently (which
is weird with no LANG env variable) would that affect how you have to manage
the results? I'm definately not a font guy, so dunno the answer to that.

On Tue, Mar 1, 2011 at 5:04 PM, Mike Bonner <[hidden email]> wrote:

> Ok, while this doesn't solve the issue, if you do
>
> shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")
>
> You get back the correct info yes?
>
> The problem here is that (I think someone said this farther up) the process
> shell uses isn't the same as a full blown terminal start. If you have a
> .bash_profile file in your user directory, and you do
>
> shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?
>
> On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]>wrote:
>
>> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
>> command, it returns nothing!!  There's definitely something weird going on
>> with the LC shell command.
>>
>> Pete Haworth
>>
>> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
>>
>> > I'd still be curious to know if
>> > env; |grep LANG
>> >
>> > returns the same environment variable value both from LC shell, and from
>> > terminal
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
In reply to this post by Mike Bonner
Thanks Mike.  'Fraid the command you gave me still returns the incorrect info when executed with the LC shell command.

In answer to your other email, I'm trying to get this info so I can format numbers and currency in my application according to the user's preferences, rather than having the user specify the same preferences to my application.  But it's quickly becoming more trouble than it's worth!


Pete Haworth








http://www.mollysrevenge.com
http://www.sonicbids.com/MollysRevenge
http://www.myspace.com/mollysrevengeband








On Mar 1, 2011, at 4:04 PM, Mike Bonner wrote:

> Ok, while this doesn't solve the issue, if you do
>
> shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")
>
> You get back the correct info yes?
>
> The problem here is that (I think someone said this farther up) the process
> shell uses isn't the same as a full blown terminal start. If you have a
> .bash_profile file in your user directory, and you do
>
> shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?
>
> On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]>wrote:
>
>> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
>> command, it returns nothing!!  There's definitely something weird going on
>> with the LC shell command.
>>
>> Pete Haworth
>>
>> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
>>
>>> I'd still be curious to know if
>>> env; |grep LANG
>>>
>>> returns the same environment variable value both from LC shell, and from
>>> terminal
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
Well if you can figure out how to get locale to work from an lc shell, there
are interesting things that can be done in that vein using python.

If LANG is set to en_GB, and locale is actually working, you can feed it to
a python script such as this

#!/usr/bin/python
import locale -- for locale stuff of course
import sys -- so we can get argv
tVal = float(sys.argv[1]) -- sets argv[1] type to float and puts in tval
locale.setlocale(locale.LC_ALL, ' ' ) -- assuming all is perfect *cough*
grabs the locale
tOut = locale.currency(tVal,1,1,0)

 -- puts out the number with adjustements. tVal is passed number, next is
whether to show or not show the symbol, next is grouping on or off, next is
use international symbol, or not. So, if LANG is set to en_GB you get back
the great brit symbol, groups of 3, seperated by comma with a "." decimal.

As you say though, not sure it'ts worth the effort, can just ask the user.

If you're curious, I got this info from
http://docs.python.org/library/locale.html

On Tue, Mar 1, 2011 at 5:24 PM, Peter Haworth <[hidden email]>wrote:

> Thanks Mike.  'Fraid the command you gave me still returns the incorrect
> info when executed with the LC shell command.
>
> In answer to your other email, I'm trying to get this info so I can format
> numbers and currency in my application according to the user's preferences,
> rather than having the user specify the same preferences to my application.
>  But it's quickly becoming more trouble than it's worth!
>
>
> Pete Haworth
>
>
>
>
>
>
>
>
> http://www.mollysrevenge.com
> http://www.sonicbids.com/MollysRevenge
> http://www.myspace.com/mollysrevengeband
>
>
>
>
>
>
>
>
> On Mar 1, 2011, at 4:04 PM, Mike Bonner wrote:
>
> > Ok, while this doesn't solve the issue, if you do
> >
> > shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")
> >
> > You get back the correct info yes?
> >
> > The problem here is that (I think someone said this farther up) the
> process
> > shell uses isn't the same as a full blown terminal start. If you have a
> > .bash_profile file in your user directory, and you do
> >
> > shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?
> >
> > On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]
> >wrote:
> >
> >> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
> >> command, it returns nothing!!  There's definitely something weird going
> on
> >> with the LC shell command.
> >>
> >> Pete Haworth
> >>
> >> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
> >>
> >>> I'd still be curious to know if
> >>> env; |grep LANG
> >>>
> >>> returns the same environment variable value both from LC shell, and
> from
> >>> terminal
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Peter Haworth-2
Thanks Mike.  I'm glad to hear there is a programming language out there that actually uses the locale information.  Unfortunately, there isn;t anything in LiveCode, for numbers and currency that is.


Pete Haworth


On Mar 1, 2011, at 4:52 PM, Mike Bonner wrote:

> Well if you can figure out how to get locale to work from an lc shell, there
> are interesting things that can be done in that vein using python.
>
> If LANG is set to en_GB, and locale is actually working, you can feed it to
> a python script such as this
>
> #!/usr/bin/python
> import locale -- for locale stuff of course
> import sys -- so we can get argv
> tVal = float(sys.argv[1]) -- sets argv[1] type to float and puts in tval
> locale.setlocale(locale.LC_ALL, ' ' ) -- assuming all is perfect *cough*
> grabs the locale
> tOut = locale.currency(tVal,1,1,0)
>
> -- puts out the number with adjustements. tVal is passed number, next is
> whether to show or not show the symbol, next is grouping on or off, next is
> use international symbol, or not. So, if LANG is set to en_GB you get back
> the great brit symbol, groups of 3, seperated by comma with a "." decimal.
>
> As you say though, not sure it'ts worth the effort, can just ask the user.
>
> If you're curious, I got this info from
> http://docs.python.org/library/locale.html
>
> On Tue, Mar 1, 2011 at 5:24 PM, Peter Haworth <[hidden email]>wrote:
>
>> Thanks Mike.  'Fraid the command you gave me still returns the incorrect
>> info when executed with the LC shell command.
>>
>> In answer to your other email, I'm trying to get this info so I can format
>> numbers and currency in my application according to the user's preferences,
>> rather than having the user specify the same preferences to my application.
>> But it's quickly becoming more trouble than it's worth!
>>
>>
>> Pete Haworth
>>
>>
>>
>>
>>
>>
>>
>>
>> http://www.mollysrevenge.com
>> http://www.sonicbids.com/MollysRevenge
>> http://www.myspace.com/mollysrevengeband
>>
>>
>>
>>
>>
>>
>>
>>
>> On Mar 1, 2011, at 4:04 PM, Mike Bonner wrote:
>>
>>> Ok, while this doesn't solve the issue, if you do
>>>
>>> shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")
>>>
>>> You get back the correct info yes?
>>>
>>> The problem here is that (I think someone said this farther up) the
>> process
>>> shell uses isn't the same as a full blown terminal start. If you have a
>>> .bash_profile file in your user directory, and you do
>>>
>>> shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?
>>>
>>> On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]
>>> wrote:
>>>
>>>> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
>>>> command, it returns nothing!!  There's definitely something weird going
>> on
>>>> with the LC shell command.
>>>>
>>>> Pete Haworth
>>>>
>>>> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
>>>>
>>>>> I'd still be curious to know if
>>>>> env; |grep LANG
>>>>>
>>>>> returns the same environment variable value both from LC shell, and
>> from
>>>>> terminal
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Following up on shell(locale) problem

Mike Bonner
Yeah, was just pointing out that since os x has python installed by default
(right?) could include a small python script and just feed it numbers
through shell anytime you wanted a currency format. Not sure how fast it
would be for lots of conversions though. /shrug

On Tue, Mar 1, 2011 at 6:37 PM, Peter Haworth <[hidden email]>wrote:

> Thanks Mike.  I'm glad to hear there is a programming language out there
> that actually uses the locale information.  Unfortunately, there isn;t
> anything in LiveCode, for numbers and currency that is.
>
>
> Pete Haworth
>
>
> On Mar 1, 2011, at 4:52 PM, Mike Bonner wrote:
>
> > Well if you can figure out how to get locale to work from an lc shell,
> there
> > are interesting things that can be done in that vein using python.
> >
> > If LANG is set to en_GB, and locale is actually working, you can feed it
> to
> > a python script such as this
> >
> > #!/usr/bin/python
> > import locale -- for locale stuff of course
> > import sys -- so we can get argv
> > tVal = float(sys.argv[1]) -- sets argv[1] type to float and puts in tval
> > locale.setlocale(locale.LC_ALL, ' ' ) -- assuming all is perfect *cough*
> > grabs the locale
> > tOut = locale.currency(tVal,1,1,0)
> >
> > -- puts out the number with adjustements. tVal is passed number, next is
> > whether to show or not show the symbol, next is grouping on or off, next
> is
> > use international symbol, or not. So, if LANG is set to en_GB you get
> back
> > the great brit symbol, groups of 3, seperated by comma with a "."
> decimal.
> >
> > As you say though, not sure it'ts worth the effort, can just ask the
> user.
> >
> > If you're curious, I got this info from
> > http://docs.python.org/library/locale.html
> >
> > On Tue, Mar 1, 2011 at 5:24 PM, Peter Haworth <[hidden email]
> >wrote:
> >
> >> Thanks Mike.  'Fraid the command you gave me still returns the incorrect
> >> info when executed with the LC shell command.
> >>
> >> In answer to your other email, I'm trying to get this info so I can
> format
> >> numbers and currency in my application according to the user's
> preferences,
> >> rather than having the user specify the same preferences to my
> application.
> >> But it's quickly becoming more trouble than it's worth!
> >>
> >>
> >> Pete Haworth
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> http://www.mollysrevenge.com
> >> http://www.sonicbids.com/MollysRevenge
> >> http://www.myspace.com/mollysrevengeband
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> On Mar 1, 2011, at 4:04 PM, Mike Bonner wrote:
> >>
> >>> Ok, while this doesn't solve the issue, if you do
> >>>
> >>> shell("LANG=en_US.UTF-8;locale -k LC_NUMERIC")
> >>>
> >>> You get back the correct info yes?
> >>>
> >>> The problem here is that (I think someone said this farther up) the
> >> process
> >>> shell uses isn't the same as a full blown terminal start. If you have a
> >>> .bash_profile file in your user directory, and you do
> >>>
> >>> shell("source ~/.bash_profile ; locale -k LC_MONETARY") does it work?
> >>>
> >>> On Tue, Mar 1, 2011 at 4:48 PM, Peter Haworth <[hidden email]
> >>> wrote:
> >>>
> >>>> OK, In terminal, that returns "LANG=en_US.UTF-8".  With the LC shell
> >>>> command, it returns nothing!!  There's definitely something weird
> going
> >> on
> >>>> with the LC shell command.
> >>>>
> >>>> Pete Haworth
> >>>>
> >>>> On Mar 1, 2011, at 2:44 PM, Mike Bonner wrote:
> >>>>
> >>>>> I'd still be curious to know if
> >>>>> env; |grep LANG
> >>>>>
> >>>>> returns the same environment variable value both from LC shell, and
> >> from
> >>>>> terminal
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> use-livecode mailing list
> >>>> [hidden email]
> >>>> Please visit this url to subscribe, unsubscribe and manage your
> >>>> subscription preferences:
> >>>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>>>
> >>> _______________________________________________
> >>> use-livecode mailing list
> >>> [hidden email]
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>>
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12