On 8 Apr 2010, at 11:35am, Alex Kides wrote: > I'm using sqlite through Qt and the problem I'm having is that in non > utf locales (e.g. ja_JP.PCK on solaris) when given a shift-jis encoded > to utf-8 string to open, the file being created is using the utf-8 > characters, i.e. when the file is ls'd the characters are garbled. If a > full path containing any non-ascii characters is given the file fails to > be found given the different encodings. > > > > I've been going through the sqlite code shipped with qt (it's the > amalgamated source so a bit of light reading ;) ) - but does anyone know > off hand if there will be untoward issues with sqlite if I modified the > qt call to sqlite so that a locale encoded string instead of utf-8 is > passed across?
It would be non-standard, and you'd have to keep modifying it each time you switched to a later version of sqlite. A better solution would be to create your own function, with same arguments as sqlite3_open(), which took a filename of any character standard and converted it to UTF-8, then called the normal sqlite3_open(). This assumes it's possible to detect that something is shift-jis encoded. If it's not, then just make a mysqlite_open_jis() which always does the conversion from ^jis to UTF-8. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

