Diff for /parser3/src/main/pa_charset.C between versions 1.107 and 1.114

version 1.107, 2017/05/17 14:22:11 version 1.114, 2024/11/04 03:53:25
Line 1 Line 1
 /** @file  /** @file
         Parser: Charset connection implementation.          Parser: Charset connection implementation.
   
         Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com)          Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com)
         Author: Alexander Petrosyan<paf@design.ru>(http://paf.design.ru)          Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru>
 */  */
   
 #include "pa_charset.h"  #include "pa_charset.h"
Line 173  void Charset::load_definition(Request_ch Line 173  void Charset::load_definition(Request_ch
                         case 8:                          case 8:
                                 // charset                                  // charset
                                 if(tables.toTableSize>MAX_CHARSET_UNI_CODES)                                  if(tables.toTableSize>MAX_CHARSET_UNI_CODES)
                                         throw Exception(PARSER_RUNTIME, &afile_spec, "charset must contain not more then %d unicode values", MAX_CHARSET_UNI_CODES);                                          throw Exception(PARSER_RUNTIME, &afile_spec, "charset must contain not more than %d unicode values", MAX_CHARSET_UNI_CODES);
   
                                 XMLCh unicode=(XMLCh)to_wchar_code(cell);                                  XMLCh unicode=(XMLCh)to_wchar_code(cell);
                                 if(!unicode && column==7/*unicode1 column*/)                                  if(!unicode && column==7/*unicode1 column*/)
Line 992  void Charset::store_Char(XMLByte*& outPt Line 992  void Charset::store_Char(XMLByte*& outPt
 #ifdef XML  #ifdef XML
   
 static const Charset::Tables* tables[MAX_CHARSETS];  static const Charset::Tables* tables[MAX_CHARSETS];
   static xmlCharEncodingHandler xml_encoding_handlers[MAX_CHARSETS];
   
 #ifdef PA_PATCHED_LIBXML_BACKWARD  #ifdef PA_PATCHED_LIBXML_BACKWARD
   
Line 1062  void Charset::addEncoding(char *name_cst Line 1063  void Charset::addEncoding(char *name_cst
         if(handlers_count==MAX_CHARSETS)          if(handlers_count==MAX_CHARSETS)
                 throw Exception(0, 0, "already allocated %d handlers, no space for new encoding '%s'", MAX_CHARSETS, name_cstr);                  throw Exception(0, 0, "already allocated %d handlers, no space for new encoding '%s'", MAX_CHARSETS, name_cstr);
   
         xmlCharEncodingHandler* handler=new xmlCharEncodingHandler;          xmlCharEncodingHandler* handler=&xml_encoding_handlers[handlers_count];
         {          {
                 handler->name=name_cstr;                  handler->name=name_cstr;
                 handler->input=inputFuncs[handlers_count];                   handler->input=inputFuncs[handlers_count]; 
Line 1246  const char *fixUTF8(const char *src){ Line 1247  const char *fixUTF8(const char *src){
                         do {                          do {
   
                                 if(error_offset){                                  if(error_offset){
                                         strncpy(dst, src, error_offset);                                          memcpy(dst, src, error_offset);
                                         dst+=error_offset;                                          dst+=error_offset;
   
                                         src+=error_offset;                                          src+=error_offset;

Removed from v.1.107  
changed lines
  Added in v.1.114


E-mail: