Changeset 22337

Show
Ignore:
Timestamp:
01.07.2010 11:43:13 (9 years ago)
Author:
mdewsnip
Message:

Added calls to to_utf8() for key and data in setkeydata(), to get the encoding right for the SQLite database.

Files:
1 modified

Legend:

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

    r22067 r22337  
    262262  if (!exists(key)) 
    263263  { 
    264     text_t sql_cmd = "INSERT INTO data (key, value) VALUES ('" + sql_safe(key) + "', '" + sql_safe(data) + "')"; 
     264    text_t sql_cmd = "INSERT INTO data (key, value) VALUES ('" + to_utf8(sql_safe(key)) + "', '" + to_utf8(sql_safe(data)) + "')"; 
    265265    return sqlexec(sql_cmd); 
    266266  } 
    267267  else 
    268268  { 
    269     text_t sql_cmd = "UPDATE data SET value='" + sql_safe(data) + "' WHERE key='" + sql_safe(key) + "'"; 
     269    text_t sql_cmd = "UPDATE data SET value='" + to_utf8(sql_safe(data)) + "' WHERE key='" + to_utf8(sql_safe(key)) + "'"; 
    270270    return sqlexec(sql_cmd); 
    271271  }