Diff for /parser3/src/classes/table.C between versions 1.382 and 1.385

version 1.382, 2026/01/08 21:13:03 version 1.385, 2026/11/28 22:13:43
Line 1 Line 1
 /** @file  /** @file
         Parser: @b table parser class.          Parser: @b table parser class.
   
         Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com)          Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com)
         Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>          Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
 */  */
   
Line 417  static void _load(Request& r, MethodPara Line 417  static void _load(Request& r, MethodPara
                 control_chars.load(*options);                  control_chars.load(*options);
   
         // loading text          // loading text
         char *data=file_load_text(r, r.full_disk_path(params.as_file_name(filename_param_index)), true, options);          char *data=file_load_text(r, r.full_disk_path(params.as_file_name(filename_param_index), PA_ALLOW_HTTP), true, options);
   
         Skip_lines_action skip_lines_action = (control_chars.separator=='#' || control_chars.encloser=='#') ? skip_empty_lines : skip_empty_and_comment_lines;          Skip_lines_action skip_lines_action = (control_chars.separator=='#' || control_chars.encloser=='#') ? skip_empty_lines : skip_empty_and_comment_lines;
   
Line 1100  struct Table_seq_item : public PA_Alloca Line 1100  struct Table_seq_item : public PA_Alloca
 };  };
 #endif  #endif
 static int sort_cmp_string(const void *a, const void *b) {  static int sort_cmp_string(const void *a, const void *b) {
         return strcmp(          return Charset::strcmp_utf8(
                 static_cast<const Table_seq_item *>(a)->value.c_str,                   static_cast<const Table_seq_item *>(a)->value.c_str, 
                 static_cast<const Table_seq_item *>(b)->value.c_str                  static_cast<const Table_seq_item *>(b)->value.c_str
         );          );
Line 1143  static void _sort(Request& r, MethodPara Line 1143  static void _sort(Request& r, MethodPara
                         seq[i].value.d=value.as_expr_result().as_double();                          seq[i].value.d=value.as_expr_result().as_double();
         }          }
   
         // @todo: handle this elsewhere          if(!r.charsets.source().isUTF8() && key_values_are_strings) { // Charset::strcmp_utf8 requires UTF-8
         if(r.charsets.source().NAME()=="KOI8-R" && key_values_are_strings) {  
                 for(i=0; i<old_count; i++)                  for(i=0; i<old_count; i++)
                         if(*seq[i].value.c_str)                          if(*seq[i].value.c_str)
                                 seq[i].value.c_str=Charset::transcode(seq[i].value.c_str, r.charsets.source(), pa_UTF8_charset).cstr();                                  seq[i].value.c_str=Charset::transcode(seq[i].value.c_str, r.charsets.source(), pa_UTF8_charset).cstr();

Removed from v.1.382  
changed lines
  Added in v.1.385


E-mail: