title: Maxlength attribute works differently on mobile and desktop browser
body: <p>"maxlength" attribute on desktop (browser) checks the size of the input and compare it with given limit whereas it compares the count of character on mobile device (browser). This is weird. For example,</p>
  
  <pre><code> Username: &lt;input type="text" name="usrname" maxlength="10"&gt;&lt;br&gt;
  </code></pre>
  
  <p>when you enter normal character it will limit you till 10 chars, which is 10 byte. When you try to enter emojis or multi language characters or unicode character, depending on the size it will stop user entering extra characters. 
  For example if you try to enter  emoji, on desktop you can enter only 5 emojis, as size of 1 emoji is 2 byte and on desktop browser wont let you cross 10 bytes.</p>
  
  <p>But on mobile browser, you will be able to enter 10 emojis. Shouldn't browsers on desktop or mobile device work same for simple attribute like maxlength. Let me know why its happening and if possible the workaround. <strong>I want mobile browser to work same as desktop browser and restrict the input size in terms of byte not count.</strong>
  Thanks in advance.</p>
  
  <p>for testing purpose:
  <a href="https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_maxlength" rel="nofollow noreferrer">https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_maxlength</a></p>