Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How to recognize letters accented?

    Hi all guy... I have the next problem... In my code I need that program recognize the letters accented: , like a normal vowels and dont a consonant!! I have insert
    Code:
    <meta charset = "UTF-8" >
    But nothing doesn't happen

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    Sadly enough you won't even get the price for "least information possible" ... there are problem descriptions that are worse

    Nevertheless: Please show us your magic code that recognizes the accented letters as consonants. How else should we know? Even my crystal ball got a headache from this ...

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,982
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Quote Originally Posted by triko View Post
    But nothing doesn't happen
    The correct English is "Nothing doesn't never happen". = "Nothing happens".

    I think he means that he has defined aeiou as vowels, and other letters as consonants, but now has run up against accented letters which he wants to treat as vowels.


    Code:
    <script type = "text/javascript">
    var x=  "  ";
    if (/^[]/.test(x)) {
    alert ("String contains an accented character");
    }
    </script>
    Last edited by Philip M; 11-26-2012 at 10:09 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    New Coder
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    The correct English is "Nothing doesn't never happen". = "Nothing happens".

    I think he means that he has defined aeiou as vowels, and other letters as consonants, but now has run up against accented letters which he wants to treat as vowels.


    Code:
    <script type = "text/javascript">
    var x=  "  ";
    if (/^[]/.test(x)) {
    alert ("String contains an accented character");
    }
    </script>
    Ok, but have a problem, the program read the " ' " than a "?"... And then return is null because don't recognize letters accented!!!
    It's for <meta> error??

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,982
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Quote Originally Posted by triko View Post
    Ok, but have a problem, the program read the " ' " than a "?"... And then return is null because don't recognize letters accented!!!
    It's for <meta> error??
    Sorry, not a clue what you mean. You must express yourself in English more clearly.

    But there was a typo in my script in Post #3 - should be

    if (/[]/.test(x)) {

    ^ means at the start of the string

    Have a look at http://www.tuxlanding.net/how-to-dis...in-javascript/
    Last edited by Philip M; 11-28-2012 at 03:48 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #6
    New Coder
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Sorry, not a clue what you mean. You must express yourself in English more clearly.

    But there was a typo in my script in Post #3 - should be

    if (/[]/.test(x)) {

    ^ means at the start of the string

    Have a look at http://www.tuxlanding.net/how-to-dis...in-javascript/
    Ok, so, I found the final problem. I do convert the letters accented: "" "" "" "" "" "", to the normal letters aeiou!! Because my program read the letters accented with consonants and I don't would this!!!
    Now is it more clear?

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,982
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Quote Originally Posted by triko View Post
    Ok, so, I found the final problem. I do convert the letters accented: "" "" "" "" "" "", to the normal letters aeiou!! Because my program read the letters accented with consonants and I don't would this!!!
    Now is it more clear?
    So you are using replace() to convert accented letters into their non-accented equivalents? But why do you not simply add the accented characters to your list of vowels?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #8
    New Coder
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    So you are using replace() to convert accented letters into their non-accented equivalents? But why do you not simply add the accented characters to your list of vowels?
    Because I don't say, if accented letters is vowels or consonants

  • #9
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,982
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Quote Originally Posted by triko View Post
    Because I don't say, if accented letters is vowels or consonants
    Accented characters which are vowels if unaccented are still vowels if they are accented. In any European language.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #10
    New Coder
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Accented characters which are vowels if unaccented are still vowels if they are accented. In any European language.
    xD
    Ok! I will remember, this! Thankssss


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •