title: Javascript: Get highest possible UTF8 character
body: <p>I need to get the highest possible UTF8 character for a prefix search.</p>
  
  <p>I have a data set like this:</p>
  
  <pre><code>A
  Ba
  Bf
  C
  </code></pre>
  
  <p>Now I can do a prefix search by specifying start and end values:</p>
  
  <pre><code>Start: B
  End: B* where * should be the highest possible UTF8 character.
  </code></pre>
  
  <p>How can I get this programatically using Javascript?</p>
  
  <p>Edit: Here is a better example:</p>
  
  <p>I need to send this prefix to a JSON RPC API. So I can't do the actual comparison in JS.</p>
  
  <p>But if I wanted to mach both strings starting with B, I would send </p>
  
  <pre><code>Start: B 
  End: B? 
  </code></pre>
  
  <p>where ? is the biggest possible UTF8 character.</p>
  
  <p>If it was ASCII, I could do <code>"B" + String.fromCharCode(255)</code>, but this is just for ASCII. My strings are in UTF8, in which case this wouldn't match all possible strings starting with B.</p>