I cant seem to get my head around Encodings...
I have a desktop app w/textArea for user to enter a comment.
I post that to an MSSQL database varchar field.
If the user input includes a single quote in the comment it posts to the database and I can see the single quotes in the MS management console tool.
However when I later requery the database and assign the comment back to the a textarea, the results vary as follows:
//strips the single quotes in the textarea
s = rs.Field("Comment").StringValue
//Each single quote appears but has an Â before them (thats A with circumflex).
s = rs.Field("Comment").StringValue.DefineEncoding(Encodings.WindowsLatin1)
s = rs.Field("Purpose").StringValue.DefineEncoding(Encodings.WindowsLatin1).ConvertEncoding(Encodings.UTF8)
s = rs.Field("Purpose").StringValue.DefineEncoding(Encodings.WindowsLatin1).ConvertEncoding(Encodings.UTF8).toText
What do I need to do differently to post strings that include quotes to the database and then read them back to display correctly?
Ive tried many combinations of Encoding defines and conversions on both the sql UPDATE and on the SELECT side and cant seem to tumble onto the solution.
(if it helps...) My sql server tells me its Collation is SQL_Latin1_General_CP1_CI_AS and Im using the SQLDatabaseMBS plugin with the FreeTDS ODBC driver)