Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Updated: "update 1", "update 2"</strong></p> <p>You can store 8 Bits in a single charakter with ANSI, ASCII or UTF-8 encoding.</p> <p>But, for example, if you whant to use ASCII-Encoding you shouldn't use the first 5 bits (0001 1111 = 0x1F) and the chars 0x7F there are represent system-charaters like "Escape, null, start of text, end of text ..) who are not can be copy and paste. So you could store 223 (1110 0000 = 0xE0) different informations in one single charakter.</p> <p>If you use UTF-16 you have 2 bytes = 16 bits - system-characters to store your informationen.</p> <pre><code>A in UTF-8 Encoding: 0x0041 (the first 2 digits are every 0!) or 0x41 A in UTF-16 Encoding: 0x0041 (the first 2 digits can be higher then 0) A in ASCII Encoding: 0x41 A in ANSI Encoding: 0x41 </code></pre> <p>see images at the and of this post!</p> <p>update 1:</p> <p>If you not need to modify the values without any tool (c#-tool, javascript-base webpage, ...) you can alternative base64 or zip+base64 your informationens. this solution avoid the problem that you descript in your 2nd update. "here are lots of control characters that I cannot use. How could I manage which characters are ok to use?"</p> <p>If this is not an option you can not avoid to use any type of lookup-table. the shortest way for an lookuptable are:</p> <pre><code>var illegalCharCodes = new byte[]{0x00, 0x01, 0x02, ..., 0x1f, 0x7f}; </code></pre> <p>or you code it like this:</p> <pre><code>//The example based on ASNI-Encoding but in principle its the same with utf-16 var value = 0; if(charcode &gt; 0x7f) value = charcode - 0x1f - 1; //-1 because 0x7f is the first illegalCharCode higher then 0x1f else value = charcode - 0x1f; value -= 1; //because you need a 0 value; //charcode: 0x20 (' ') -&gt; value: 0 //charcode: 0x21 ('!') -&gt; value: 1 //charcode: 0x22 ('"') -&gt; value: 2 //charcode: 0x7e ('~') -&gt; value: 94 //charcode: 0x80 ('€') -&gt; value: 95 //charcode: 0x81 ('�') -&gt; value: 96 //.. </code></pre> <p>update 2:</p> <p>for Unicode (UTF-16) you can use this table: <a href="http://www.tamasoft.co.jp/en/general-info/unicode.html" rel="nofollow noreferrer">http://www.tamasoft.co.jp/en/general-info/unicode.html</a> Any character represent with a symbol like or are empty you should not use. So you can not store 50,000 possible values in one utf-16 character if you allow to copy and past them. you need any spezial-encoder and you must use 2 UTF-16 character like: </p> <pre><code>//charcode: 0x0020 + 0x0020 (' ') &gt; value: 0 //charcode: 0x0020 + 0x0020 (' !') &gt; value: 2 //charcode: 0x0020 + 0x0020 ('!A') &gt; value: something higher 40.000, i dont know excatly because i dont have count the illegal characters in UTF-16 :D </code></pre> <p><a href="http://www.asciitable.com/asciifull.gif" rel="nofollow noreferrer">ASCII-Table http://www.asciitable.com/asciifull.gif</a> <a href="http://www.asciitable.com/extend.gif" rel="nofollow noreferrer">ASCII-Table extended http://www.asciitable.com/extend.gif</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload