CString Format problem and differences in Windows XP and 7?
There is a problem, below code works for Windows 7 and not for Windows XP? By any chance, do you know the reason for that? Thanks in advance. I have checked that it is not a DB error.
For Win 7 it returns what is stored, also the same case for Win XP. But, Formatting in XP sets CString as ""
.
if(getDB()->getEncoding() == IDatabase::UTF8){
a_value.Format(_T("%s"), sqlite3_column_text(getCommand()->getStatement(), idx));
}else{
a_value.Format(_T("%s"), sqlite3_column_text16(getCommand()->getStatement(), idx));
}
Also, we are sur开发者_如何转开发e that it is not a unicode issue.
This really doesn't appear to be a Windows issue. Are you sure you're not doing different builds between the version that works and the one that doesn't?
The code above is problematic because if you do a Unicode build, sqlite3_column_text()
will return the wrong type of string. For Unicode builds, you'd want sqlite3_column_text16()
instead.
check if character set configured during compilation is the same on the two platform
unicode
or
multibyte
maybe it helps, bye
精彩评论