How to detect UniCode character

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gyanendar
    New Member
    • Jun 2007
    • 90

    How to detect UniCode character

    Hi All,

    What is the way to detect Non-Ascii character in C#?

    Say,User will input character sequence(May be in Non English say German) and we need to find which character is Non-Ascii.



    -Gyanendar
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    You want to allow inly English characters?

    Regards
    Dheeraj Joshi

    Comment

    • gyanendar
      New Member
      • Jun 2007
      • 90

      #3
      Yes Dheeraj
      Need to detect any non english character.

      Gyanendar

      Comment

      • ThatThatGuy
        Recognized Expert Contributor
        • Jul 2009
        • 453

        #4
        Originally posted by gyanendar
        Hi All,

        What is the way to detect Non-Ascii character in C#?

        Say,User will input character sequence(May be in Non English say German) and we need to find which character is Non-Ascii.



        -Gyanendar
        Check each character in the ASCII Range i.e up till 255..
        may be something like that

        Comment

        • Dheeraj Joshi
          Recognized Expert Top Contributor
          • Jul 2009
          • 1129

          #5
          Yeah. ThatThatGuy is correct. Check the ASCII of the input characters. If you get any non English character restrict the user.

          Regards
          Dheeraj Joshi

          Comment

          Working...