locked
Textbox needs to accept text from other languages. RRS feed

  • Question

  • User1002646403 posted

    I guess I need a primer on how non English language input works with asp.net textboxes.

    1. Can a regular asp.net textarea or a textbox accept text from languages other than English?

    2. If yes, then how does the user enter non English language text

    3. Is there a way to detect what language the user has entered text and make UI changes accordingly. (Ex: Make a button visible if non English text is entered)

    4. Can non English text be stored in a varchar column in a SQL Server database? If not, how do I store this text?

    Thanks!

    Monday, November 8, 2010 11:38 AM

Answers

  • User688842491 posted

    1. Can a regular asp.net textarea or a textbox accept text from languages other than English?

     

    Based on your reply, the answer would be Yes.

    then how does the user enter non English language text

    The same way they would type any other document, nothing special.

    Is there a way to detect what language the user has entered text and make UI changes accordingly. (Ex: Make a button visible if non English text is entered)

    There is a ServerVariable that can be used for this, but most sites utilize the ability to select the preferred language (the general flag icon or language selection)

    Can non English text be stored in a varchar column in a SQL Server database? If not, how do I store this text?

    Yes but you will want to store it as Unicode (http://en.wikipedia.org/wiki/Unicode).  Need to make sure that your database is schema's for Unicode otherwise you will get the garbage characters such as the blocks or various non-Unicode characters in the ASCII table.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 8, 2010 5:37 PM

All replies

  • User688842491 posted

    1. Can a regular asp.net textarea or a textbox accept text from languages other than English?

     

    yes, but will need to learn about Localization theories.

    2. If yes, then how does the user enter non English language text

     

    As long as you have the Localization setting correct, the user wont need to do anything else aside from the typing on the keyboard.

    3. Is there a way to detect what language the user has entered text and make UI changes accordingly. (Ex: Make a button visible if non English text is entered)

    Again this is centered around the Localization of the .Net framework.  I might be wrong but the Localization is based on the Browser language definition.  Although you could easily query this during the Session_Start event in Global.asax.

    4. Can non English text be stored in a varchar column in a SQL Server database? If not, how do I store this text?

     

    you will need to make sure you accomidate for this in your Database design.  You have really two choices, develop a database schema according to languages (not advisable) or develop a database schema that is language neutral but will most likely have some overhead to it if you have the database schema handle the translation between the languages or the web server.

    Monday, November 8, 2010 1:07 PM
  • User1002646403 posted

    My understanding is that localization is used to alter the text in the UI based on the user's language. For ex: Submit in English would be something else in a different language. I tend to think my questions are unrelated to localization (although I may be wrong).

    Monday, November 8, 2010 5:17 PM
  • User688842491 posted

    1. Can a regular asp.net textarea or a textbox accept text from languages other than English?

     

    Based on your reply, the answer would be Yes.

    then how does the user enter non English language text

    The same way they would type any other document, nothing special.

    Is there a way to detect what language the user has entered text and make UI changes accordingly. (Ex: Make a button visible if non English text is entered)

    There is a ServerVariable that can be used for this, but most sites utilize the ability to select the preferred language (the general flag icon or language selection)

    Can non English text be stored in a varchar column in a SQL Server database? If not, how do I store this text?

    Yes but you will want to store it as Unicode (http://en.wikipedia.org/wiki/Unicode).  Need to make sure that your database is schema's for Unicode otherwise you will get the garbage characters such as the blocks or various non-Unicode characters in the ASCII table.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 8, 2010 5:37 PM