--- parser3/src/main/pa_request.C 2001/04/04 10:50:36 1.95 +++ parser3/src/main/pa_request.C 2001/04/05 18:23:00 1.97 @@ -5,11 +5,13 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.C,v 1.95 2001/04/04 10:50:36 paf Exp $ + $Id: pa_request.C,v 1.97 2001/04/05 18:23:00 paf Exp $ */ #include "pa_config_includes.h" +#include + #include "pa_sapi.h" #include "pa_common.h" #include "pa_request.h" @@ -99,6 +101,8 @@ static void add_header_attribute(const H the file user requested us to process all located classes become children of one another, composing class we name 'MAIN' + + @todo figure out 'setlocale' thread safety */ void Request::core(const char *root_auto_path, bool root_auto_fail, const char *site_auto_path, bool site_auto_fail, @@ -205,6 +209,24 @@ void Request::core(const char *root_auto if(Table *table=element->get_table()) mime_types=table; + // $MAIN:LOCALE.ctype[Russian_Russia.1251] +/* +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 +*/ + if(Value *locale=main_class->get_element(*locale_name)) + if(Value *element=locale->get_element(*locale_ctype_name)) { + const String& name=element->as_string(); + if(!setlocale(LC_CTYPE, name.cstr())) + THROW(0, 0, + &name, + "locale is invalid"); + } + // execute @main[] const String *body_string=execute_method(*main_class, *main_method_name); if(!body_string)