Use of setlocale

View: New views
2 Messages — Rating Filter:   Alert me  

Use of setlocale

by Roger Leigh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I noticed that there's quite a mix of code using stp_setlocale and
plain setlocale.  Should we have a policy of using stp_setlocale
everywhere unless strictly needed when setting a specific locale facet
such as LC_NUMERIC?

stp_init is using plain setlocale.  genppd uses this, but should we
additionally call stp_setlocale to ensure LC_CTYPE and LC_NUMERIC are
set to C?


Regards,
Roger

--
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gimp-print-devel mailing list
Gimp-print-devel@...
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel

attachment0 (202 bytes) Download Attachment

Re: Use of setlocale

by Michael R Sweet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Roger Leigh wrote:
> I noticed that there's quite a mix of code using stp_setlocale and
> plain setlocale.  Should we have a policy of using stp_setlocale
> everywhere unless strictly needed when setting a specific locale facet
> such as LC_NUMERIC?
>
> stp_init is using plain setlocale.  genppd uses this, but should we
> additionally call stp_setlocale to ensure LC_CTYPE and LC_NUMERIC are
> set to C?

I don't think stp_init should be calling setlocale at all - libraries
have no place changing the current locale settings.

--
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gimp-print-devel mailing list
Gimp-print-devel@...
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel
LightInTheBox - Buy quality products at wholesale price!