Date: 04/20/00
- Next message: Zeev Suraski: "[PHP-DEV] OP_RELOGIN and imap_popen() on IMAP"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #4210 Updated: recursive zend_hash causes SIGBUS"
- Next in thread: thies <email protected>: "Re: [PHP-DEV] setlocale(LC_CTYPE, "") in main.c"
- Reply: thies <email protected>: "Re: [PHP-DEV] setlocale(LC_CTYPE, "") in main.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is there any special reason for setting only LC_CTYPE and not LC_ALL in
main.c?
The problem now is that setlocale(LC_ALL, "") is, in fact, how the
locale is reset after the user has changed it with the PHP function
'setlocale' (this is
done in PHP_RSHUTDOWN_FUNCTION(basic), ext/standard/basic_functions.c).
So if I change the locale settings with 'setlocale' in a script, when
the script
is finished the locale settings for the Apache process wont necessary be
the
same as before the script was run.
One side effect of this is that one process can get different locale
settings
then the others. This makes (how I first noticed the problem) repeated
execution
of a simple script like this
<?php print(setlocale(LC_ALL, 0)) ?>
produce varying (random, sort of) results. The results here depends of
curse
on which process happened to serve the request.
Possible patch:
--- main.c.orig Wed Apr 19 23:43:34 2000
+++ main.c Wed Apr 19 23:43:53 2000
@@ -837,7 +837,7 @@
PG(connection_status) = PHP_CONNECTION_NORMAL;
#if HAVE_SETLOCALE
- setlocale(LC_CTYPE, "");
+ setlocale(LC_ALL, "");
#endif
#ifdef PHP_WIN32
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Zeev Suraski: "[PHP-DEV] OP_RELOGIN and imap_popen() on IMAP"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #4210 Updated: recursive zend_hash causes SIGBUS"
- Next in thread: thies <email protected>: "Re: [PHP-DEV] setlocale(LC_CTYPE, "") in main.c"
- Reply: thies <email protected>: "Re: [PHP-DEV] setlocale(LC_CTYPE, "") in main.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

