triko
11-26-2012, 07:40 PM
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!! :D I have insert
<meta charset = "UTF-8" >
But nothing doesn't happen
devnull69
11-26-2012, 08:27 PM
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 ...
Philip M
11-26-2012, 09:51 PM
But nothing doesn't happen
The correct English is "Nothing doesn't never happen". :D = "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.
<script type = "text/javascript">
var x= "à á è";
if (/^[àèìòù]/.test(x)) {
alert ("String contains an accented character");
}
</script>
triko
11-28-2012, 03:37 PM
The correct English is "Nothing doesn't never happen". :D = "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.
<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??
Philip M
11-28-2012, 03:40 PM
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-display-the-accented-characters-in-javascript/
triko
11-28-2012, 04:44 PM
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-display-the-accented-characters-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!!! :D
Now is it more clear? :D
Philip M
11-28-2012, 05:12 PM
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!!! :D
Now is it more clear? :D
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?
triko
11-28-2012, 05:36 PM
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 :D
Philip M
11-28-2012, 05:40 PM
Because I don't say, if accented letters is vowels or consonants :D
Accented characters which are vowels if unaccented are still vowels if they are accented. In any European language.
triko
11-28-2012, 06:59 PM
Accented characters which are vowels if unaccented are still vowels if they are accented. In any European language.
xD
Ok! I will remember, this! :D Thankssss