A user on my website could possibly add a comment on an item that contains both Arabic and English characters. sometimes maybe just Arabic, others just English, and others French!
It’s an international website you can’t expect the characters being stored in my application.
My website has nothing to do with the Facebook but I need my comments’ TextBoxes to be able to accept and show any characters from any language!
…So how do you think I could achieve this ?
All strings in .NET are unicode strings (see documentation of the
Stringclass for more information). So taking input from the user in a mix of languages shouldn’t be a problem.If you plan to store this information in the database you will need to make sure the database columns are of type
ncharornvarchar. As others pointed out, when you run queries against these columns out of SSMS you will need to prefix Unicode strings withNto make sure they are handled properly. When executing queries from code you should use parameterized queries (or an ORM, which would probably be better) and ADO.NET will take care of properly constructing queries for you.