Re: Following up on shell(locale) problem

2011-03-02 Thread Warren Samples
On Tue, 2011-03-01 at 18:10 -0800, Peter Haworth wrote: That's definitely an option if I don't find a solution to getting the locale info from within LiveCode. Unfortunately, I know nothing about python. I've been sent some pretty cool LC scripts to do this formatting in response to my

Re: Following up on shell(locale) problem

2011-03-02 Thread Warren Samples
On Wed, 2011-03-02 at 10:37 -0600, Warren Samples wrote: On Tue, 2011-03-01 at 18:10 -0800, Peter Haworth wrote: That's definitely an option if I don't find a solution to getting the locale info from within LiveCode. Unfortunately, I know nothing about python. I've been sent some

Re: Following up on shell(locale) problem

2011-03-02 Thread Peter Haworth
That's what happens with me too. This is getting stranger! I've posted this as a bug in the QC. I'm not 100% it's a Livecode problem since the same thing occurs using Applescript but someone at RunRev may be able to enlighten me on what's going on. Pete Haworth

Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Jeff 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 p...@mollysrevenge.comwrote:

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread François Chaplais
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 :

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Warren Samples
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread Mike Bonner
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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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 bonnm...@gmail.com wrote:

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread 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

Re: Following up on shell(locale) problem

2011-03-01 Thread Peter Haworth
That's definitely an option if I don't find a solution to getting the locale info from within LiveCode. Unfortunately, I know nothing about python. I've been sent some pretty cool LC scripts to do this formatting in response to my post about it. I'm almost at the point where I will just have