httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject Re: Apache PR#76: setlocale()
Date Tue, 18 Feb 1997 11:29:12 GMT
    Michael,

    Until Apache *does* do something formal with locales, as Marc
    pointed out, here is a patch that should do what you want
    specifically for CGI scripts.

    Thanx for bringing this to our attention, and for using Apache!

    #ken    :-)}

Index: mod_include.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_include.c,v
retrieving revision 1.22
diff -c -w -r1.22 mod_include.c
*** 1.22	1997/02/17 05:22:57
--- mod_include.c	1997/02/17 19:44:07
***************
*** 66,71 ****
--- 66,72 ----
  #include "http_log.h"
  #include "http_main.h"
  #include "util_script.h"
+ #include <locale.h>
  
  #define STARTING_SEQUENCE "<!--#"
  #define ENDING_SEQUENCE "-->"
***************
*** 1732,1737 ****
--- 1733,1739 ----
      enum xbithack *state =
  	(enum xbithack *)get_module_config(r->per_dir_config,&includes_module);
      int errstatus;
+     char *old_locale;
  
      if (!(allow_options (r) & OPT_INCLUDES)) return DECLINED;
      if (r->method_number != M_GET) return DECLINED;
***************
*** 1759,1764 ****
--- 1761,1768 ----
  	return OK;
      }
     
+     old_locale = pstrdup (r->pool, setlocale (LC_ALL, NULL));
+     setlocale (LC_ALL, "");
      if (r->main) {
  	/* Kludge --- for nested includes, we want to keep the
  	 * subprocess environment of the base document (for compatibility);
***************
*** 1775,1780 ****
--- 1779,1785 ----
      }
      
      send_parsed_content (f, r);
+     setlocale (LC_ALL, old_locale);
      
      kill_timeout (r);
      return OK;

Mime
View raw message