javascript capitalise next letter after html entitiy entries issue
<p>I have a form that when the user enters their name it automatically capitalise's the first character of each, but when the user has a special character within their name such as 'è' then the code then precedes to capitalise the next character after.</p>

<p>EG: </p>

<p>Joesph Bloggs works fine but if I enter Joèsph Bloggs it actually outputs it as  JoèSph Bloggs.</p>

<p>Notice the capital S in the middle of the name.  The code I use at present is the following, any ideas how to prevent this?</p>

<p>Thanks </p>

<pre><code>  capFirstLetters= function(str){
    return  str.toLowerCase().replace(/\b[a-z]/g, function(letter) {return letter.toUpperCase();});
}
</code></pre>
