character type detection
<p>Below is what I've already written and it's working fine:</p>

<pre><code>var $remaining = $('#remaining'),
$messages = $remaining.next();

$('#message').keyup(function(){
var chars = this.value.length,
    messages = Math.ceil(chars / 160),
    remaining = messages * 160 - (chars % (messages * 160) || messages * 160);

$remaining.text(remaining + ' characters remaining');
$messages.text(messages + ' message(s)');
</code></pre>

<p>});
<a href="http://jsfiddle.net/lonesomeday/nkuBa/" rel="nofollow">This is the above code in action</a></p>

<p>And now what I'm trying to do is : </p>

<pre><code>var text_max_En = 100;
var text_max_utf8 = 200;
if   /*  what user has typed is English   */
{
   Do this
}
else if /*  what user has typed is in utf8 type*/
{
   Do that
}
</code></pre>

<p>In short :</p>

<p><code>**If**</code> user has typed there in English then it should count up to 100 characters per message </p>

<p><code>AND **if**</code> that's in urf8 type then it should count up to 200 ones.</p>

<p>Any solution?</p>
