October 14th, 2009, 07:59 AM
Writing UNICODE CString to SQLServer UCS-2
Im needing to write a line of text to a sqlserver table,
The line of text could come from any webpage using any encoding.
Previously I had a problem displaying this text within my application, but could use some conversion functions to display it correctly such as:
CStringA alpha = W2A(mFromText.c_str());
CStringW wide = CA2WEX<>(alpha, GetCodePage());
My program is built using _UNICODE.
I am dynamically constructing an sql statement and using an odbc driver.
Now when the line of text is some other text such as cyrillic alls that is stored in the db is ??????
Prior to the sql being executed the sql string contains the correct text.
How do I store a UNICODE string to sql-server and it preserve its content correctly?
Originally my column type was varchar and then changed to nvarchar but no difference?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.