Re: sql select with unicode
Your first option will only work if you tell Qt it is UTF-8 encoded (assuming it is):
Code:
QSqlQuery qry
(QString::fromUtf8("SELECT st_astext(way) FROM planet_osm_roads WHERE boundary='administrative' AND admin_level='2' AND name='სáƒáƒ¥áƒáƒ თველáƒ' "));
Your second option will only work if you escape the backslashes correctly for a C++ string:
Code:
QSqlQuery qry
("SELECT st_astext(way) FROM planet_osm_roads WHERE boundary='administrative' AND admin_level='2' AND name=U&'\\10e1\\10d0\\10e5\\10d0\\10e0\\10d7\\10d5\\10d4\\10da\\10dd' ");
You should use query parameters rather than pasting string fragments together when building the SQL. This is especially important if the name comes from a user.