Ignore:
Timestamp:
2010-07-01T11:43:13+12:00 (14 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.

File:
1 edited

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  }
Note: See TracChangeset for help on using the changeset viewer.