caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] postscript, printf module and coma separator.
@ 2001-06-08 16:33 Sven LUTHER
  2001-06-11 17:30 ` [Caml-list] " Nicolas GEORGE
  0 siblings, 1 reply; 5+ messages in thread
From: Sven LUTHER @ 2001-06-08 16:33 UTC (permalink / raw)
  To: caml-list; +Cc: nicolas.george

Hello, ...

I am playing with the postscript.ml module from Nicolas Georges.

Unfortunately, i have the LANG variable set to fr_FR, and as thus fprintf
outputs floats as :

3,14

but this is not a valid postscript coordinate. 

removing the LANG variable give me the standard 3.14 output, which is
acceptable to generate postscript files.

Is there a way to have printf output floats in the standard C "." format,
independent of locales ?

Or is the best guess as how to solve this to backup, change to "" and then set
again the LANG variable using the appropriate ocaml functions ?

Friendly,

Svne Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Caml-list] Re: postscript, printf module and coma separator.
  2001-06-08 16:33 [Caml-list] postscript, printf module and coma separator Sven LUTHER
@ 2001-06-11 17:30 ` Nicolas GEORGE
  2001-06-12 11:03   ` Sven LUTHER
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas GEORGE @ 2001-06-11 17:30 UTC (permalink / raw)
  To: Sven LUTHER; +Cc: caml-list

Le decadi 20 prairial, an CCIX, Sven LUTHER a écrit :
> I am playing with the postscript.ml module from Nicolas Georges.

:-)

> Unfortunately, i have the LANG variable set to fr_FR, and as thus fprintf
> outputs floats as :
> 
> 3,14
> 
> but this is not a valid postscript coordinate. 

That seems strange. I have also LANG and LC_CTYPE set to fr_FR, and I do
not have the problem. And that under Linux (GNU libc) and Solaris. There is
the problem with LablGtk, because GMain.Main.init sets the locale (if you
use the toplevel, you can not even enter a new non-integer float, since the
ascii -> number fails on the `.'). So I think the bug is inside LablGtk,
and should be corrected there (maybe an optional parameter to change the
environment variable before gtk_set_locale).
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Caml-list] Re: postscript, printf module and coma separator.
  2001-06-11 17:30 ` [Caml-list] " Nicolas GEORGE
@ 2001-06-12 11:03   ` Sven LUTHER
  0 siblings, 0 replies; 5+ messages in thread
From: Sven LUTHER @ 2001-06-12 11:03 UTC (permalink / raw)
  To: Nicolas GEORGE; +Cc: Sven LUTHER, caml-list, lablgtk

On Mon, Jun 11, 2001 at 07:30:53PM +0200, Nicolas GEORGE wrote:
> Le decadi 20 prairial, an CCIX, Sven LUTHER a écrit :
> > I am playing with the postscript.ml module from Nicolas Georges.
> 
> :-)
> 
> > Unfortunately, i have the LANG variable set to fr_FR, and as thus fprintf
> > outputs floats as :
> > 
> > 3,14
> > 
> > but this is not a valid postscript coordinate. 
> 
> That seems strange. I have also LANG and LC_CTYPE set to fr_FR, and I do
> not have the problem. And that under Linux (GNU libc) and Solaris. There is
> the problem with LablGtk, because GMain.Main.init sets the locale (if you
> use the toplevel, you can not even enter a new non-integer float, since the
> ascii -> number fails on the `.'). So I think the bug is inside LablGtk,
> and should be corrected there (maybe an optional parameter to change the
> environment variable before gtk_set_locale).

Yes this is also the case, just tried it in a toplevel here.

Let's move this thread to the lablgtk list if needed.

Friendly,

Sven Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] postscript, printf module and coma separator.
  2001-06-08 17:02 [Caml-list] " Dave Berry
@ 2001-06-11 15:36 ` Sven LUTHER
  0 siblings, 0 replies; 5+ messages in thread
From: Sven LUTHER @ 2001-06-11 15:36 UTC (permalink / raw)
  To: Dave Berry; +Cc: Sven LUTHER, caml-list, nicolas.george

On Fri, Jun 08, 2001 at 06:02:41PM +0100, Dave Berry wrote:
> >From the book I have in front of me (which may not be accurate), it
> should be possible to set the formatting of numeric types independently
> of the other locale settings:
> 
> setenv LANG <Locale1>
> setenv LC_NUMERIC <Locale2>
> 
> It also says that ISO C specifies a "C" Locale, which behaves the same
> as uninternationalised C functions.  So it *should* be possible to use:
> 
> setenv LANG fr_FR
> setenv LC_NUMERIC C
> 
> I have no idea whether this works in practice.

mmm, yes, that's a good idea, but still, you have to do it from the shell.

What i wanted is to do it from the ocaml program i am running though, so that
it will work whatever the environement, but then maybe a specialized printf
function could be done, don't know.

Friendly,

Sven Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Caml-list] postscript, printf module and coma separator.
@ 2001-06-08 17:02 Dave Berry
  2001-06-11 15:36 ` Sven LUTHER
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Berry @ 2001-06-08 17:02 UTC (permalink / raw)
  To: Sven LUTHER, caml-list; +Cc: nicolas.george

>From the book I have in front of me (which may not be accurate), it
should be possible to set the formatting of numeric types independently
of the other locale settings:

setenv LANG <Locale1>
setenv LC_NUMERIC <Locale2>

It also says that ISO C specifies a "C" Locale, which behaves the same
as uninternationalised C functions.  So it *should* be possible to use:

setenv LANG fr_FR
setenv LC_NUMERIC C

I have no idea whether this works in practice.

Dave.


-----Original Message-----
From: Sven LUTHER [mailto:luther@dpt-info.u-strasbg.fr]
Sent: 08 June 2001 17:33
To: caml-list@inria.fr
Cc: nicolas.george@ens.fr
Subject: [Caml-list] postscript, printf module and coma separator.


Hello, ...

I am playing with the postscript.ml module from Nicolas Georges.

Unfortunately, i have the LANG variable set to fr_FR, and as thus
fprintf
outputs floats as :

3,14

but this is not a valid postscript coordinate. 

removing the LANG variable give me the standard 3.14 output, which is
acceptable to generate postscript files.

Is there a way to have printf output floats in the standard C "."
format,
independent of locales ?

Or is the best guess as how to solve this to backup, change to "" and
then set
again the LANG variable using the appropriate ocaml functions ?

Friendly,

Svne Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ:
http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives:
http://caml.inria.fr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-06-12 11:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08 16:33 [Caml-list] postscript, printf module and coma separator Sven LUTHER
2001-06-11 17:30 ` [Caml-list] " Nicolas GEORGE
2001-06-12 11:03   ` Sven LUTHER
2001-06-08 17:02 [Caml-list] " Dave Berry
2001-06-11 15:36 ` Sven LUTHER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).