Changeset 22837

Show
Ignore:
Timestamp:
02.09.2010 13:39:34 (9 years ago)
Author:
davidb
Message:

Need to get the sql_cmd in UTF-8 form to send through sqlite3_exec. Simply calling 'getcstr()' on the text_t string returns '?' for any char > 128

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/lib/sqlitedbclass.cpp

    r22337 r22837  
    302302  if (sqlitefile == NULL) return false; 
    303303 
    304   char *sql_cmd_cstr = sql_cmd.getcstr(); 
     304  char* sql_cmd_cstr = to_utf8(sql_cmd).getcstr(); 
    305305 
    306306  int rv = 0; 
     
    355355  if (sqlitefile == NULL) return false; 
    356356 
    357   char *sql_cmd_cstr = sql_cmd.getcstr(); 
     357  char* sql_cmd_cstr = to_utf8(sql_cmd).getcstr(); 
    358358  sql_results.erase(sql_results.begin(), sql_results.end()); 
    359359 
     
    373373 
    374374  delete[] sql_cmd_cstr; 
    375  
     375  
    376376  if (rv == SQLITE_OK) return true; 
    377377