Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: Problème_avec_float_of_string_en_utilisant_lablgtk_ (PR#275) #2677

Closed
vicuna opened this issue Feb 5, 2001 · 1 comment
Closed

Re: Problème_avec_float_of_string_en_utilisant_lablgtk_ (PR#275) #2677

vicuna opened this issue Feb 5, 2001 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 5, 2001

Original bug ID: 277
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Je rencontre un pb avec la fonction float_of_string : elle
ne semble pas utiliser le même séparateur entre la partie
entière et la partie décimale, selon que l'on utilise ou
non lablgtk.

Oui, comme l'a dit Jacques, c'est un problème inattendu avec la
"localisation" de la bibliothèque C: GTK appelle setlocale(), ce qui
avec les variables de ton environnement (qui doit être "francisé")
change les règles de parsing des flottants utilisées par atof() !

Je ne vois pas de solution simple sauf à réécrire une version d'atof()
spécialisée pour Caml, mais c'est un gros boulot... Dans la libc de
Linux, il y a bien une variante de atof à laquelle on peut dire
d'ignorer le "locale" courant, mais c'est hautement non portable!

Je trouve quand même que GTK est un peu limite sur ce coup-là:
setlocale() ne devrait être appelé que par le programme principal, et
non par une bibliothèque. Aussi, l'interface de "localisation" de la
libc est mal fichue, mais c'est standard :-(

  • Xavier Leroy
@vicuna
Copy link
Author

vicuna commented Feb 12, 2001

Comment author: administrator

See #2675

@vicuna vicuna closed this as completed Oct 30, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant