]> granicus.if.org Git - php/commitdiff
Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 18 Jan 2007 23:20:24 +0000 (23:20 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 18 Jan 2007 23:20:24 +0000 (23:20 +0000)
NEWS
ext/date/lib/parse_tz.c

diff --git a/NEWS b/NEWS
index a5f205abb0ae4e5a32dc4a2a0c92a912594ae0cc..b2ccf8d1c57fb5898881de27fe437a3209cc4234 100644 (file)
--- 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)
index 31e42dec8465617d11258d93d425bec5ea7cd631..4f99d22c54575531df6888a460ecec826c269683 100644 (file)
@@ -21,6 +21,7 @@
 #include "timelib.h"
 
 #include <stdio.h>
+#include <locale.h>
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -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;
 }