From: Ilia Alshanetsky Date: Thu, 18 Jan 2007 23:20:24 +0000 (+0000) Subject: Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). X-Git-Tag: php-5.2.1RC3~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f98a771e6ad876ec6f1da0104530f3f3ee0a885;p=php Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). --- diff --git a/NEWS b/NEWS index a5f205abb0..b2ccf8d1c5 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ PHP NEWS - Fixed bug #40036 (empty() does not work correctly with ArrayObject when using ARRAY_AS_PROPS). (Ilia) - Fixed bug #40002 (Try/Catch performs poorly). (Dmitry) +- Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). (Ilia) - Fixed bug #39990 (Cannot "foreach" over overloaded properties). (Dmitry) - Fixed bug #39988 (type argument of oci_define_by_name() is ignored). (Chris Jones, Tony) diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index 31e42dec84..4f99d22c54 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -21,6 +21,7 @@ #include "timelib.h" #include +#include #ifdef HAVE_STRING_H #include @@ -195,6 +196,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz) static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) { int left = 0, right = tzdb->index_size - 1; + char *cur_locale = setlocale(LC_CTYPE, "C"); do { int mid = ((unsigned)left + right) >> 1; @@ -206,11 +208,13 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const left = mid + 1; } else { /* (cmp == 0) */ (*tzf) = &(tzdb->data[tzdb->index[mid].pos + 20]); + setlocale(LC_CTYPE, cur_locale); return 1; } } while (left <= right); + setlocale(LC_CTYPE, cur_locale); return 0; }