What I am working with:
Within my Asp.net Webforms application, I am getting form data from the user and then inserting that data into a SQL Server database. Each key is the identifier for the field from within the form, and the value is the data received by the user.
My Issue:
My issue is that users are copying and pasting UTF-8 data from emails, etc into the "notes" field. The SQL Server database does not recognize UTF-8 as valid character data. Instead, it utilizes both the the UCS-2 & ISO-8859-1 character sets. Thus, these character sets are being inserted into the database as question marks (?). So, I would like to properly convert any UTF-8 characters to UCS-2 or ISO-8859-1.
Questions:
- Should I convert the UTF-8 characters to UCS-2 or to ISO-8859-1?
- Within the ASP.NET web form, what is the best means of determining the character sets used within the value for the "notes" key of my hashtable?
- What is the best possible means for converting the characters that are UTF-8 into the acceptable character set?