24 comments

  • 2shortplanks8 hours ago
    On a practical matter, it seems like a bad idea to have codepoints that can take up to an arbitrary number of bytes - this just screams buffer overflow problems.<p>So in practicality, you’re going to want an arbitrary limit on this (the article suggests as much). But if you place a limit on it then you’ve got one implementation of the standard that can decode certain characters and another that can’t. Better to have one standard that puts a hard limit on the number of bytes and another standard that uses more bytes and so on.
    • Pannoniae53 minutes ago
      You don&#x27;t have a buffer overflow problem if you read it in a memory-safe way i.e. read it in chunks and realloc when you reach the size of your allocation.<p>What you <i>will</i> have is a potential denial-of-service attack - although this one isn&#x27;t particularly great because there&#x27;s zero amplification (they might as well just send garbage into your firewall)
    • Retr0id2 hours ago
      In regular unicode, a grapheme can be made up of an arbitrary number of codepoints (and thus an arbitrary number of bytes), which does cause issues at times.
    • explodes28 minutes ago
      Limit the codepoint to the number of atoms in the universe (less than 32 bytes).
    • saghm1 hour ago
      &gt; this just screams buffer overflow problems<p>Without endorsing this specific idea, I think maybe after over half a century of C that this argument shouldn&#x27;t get in the way of a new standard. Pretty much every other language has managed to solve this problem, and the people who write new projects in C&#x2F;C++ have decided they&#x27;re not concerned about buffer overflows, so if someone decides to start a new project using something like this (or go out of their way to add support for it to an existing project), that&#x27;s kind of on them. The rest of computing shouldn&#x27;t get stuck in 1972 forever.
    • flohofwoe8 hours ago
      OTH UTF-8 is just one variable-length stream encoding among many others (RLE, LBE128, etc...).
      • DmitryOlshansky1 hour ago
        The bonus is synchonizing at arbitrary point in stream and that ASCII is UTF-8
      • saghm1 hour ago
        Unless I&#x27;m misremembering, even UTF-16 is variable. You need to bump up to UTF-32 to get fixed-width.
        • cyphar57 minutes ago
          Even better, it&#x27;s arguably <i>both</i> -- surrogate characters are valid codepoint values so technically UTF-16 is fixed-width but programs need to have special handling for surrogate pairs meaning it is practically variable-width.<p>Truly the worst of all worlds.
        • mafuy36 minutes ago
          Correct me if I&#x27;m wrong, but I think all kinds of UTF, including 16 and 32, support arbitrary length for a single effective character. This would be because you can stack modifications as long as you like.
  • bastawhiz1 hour ago
    At some point it just collapses into a sort of Huffman coding of every possible 4096 bit embedding vector.
  • sph9 hours ago
    &gt; UTF-8000 is in no way endorsed by or representative of the Unicode Consortium.<p>Not until they decide to expand the emoji range, allocate space for all past and future fictional languages, as well as birdsong and dog barks.<p>Someone at the consortium is rubbing their hands with glee with all the newfound space.<p>But honestly, cool hack! If you invent a method to encode large numbers into bytes, why limit yourself to 24-bit numbers?
    • throw0101a5 hours ago
      &gt; […] <i>why limit yourself to 24-bit numbers?</i><p>For compatibility with UTF-16:<p><pre><code> o Restricted the range of characters to 0000-10FFFF (the UTF-16 accessible range). </code></pre> * <a href="https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;rfc3629#section-12" rel="nofollow">https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;rfc3629#section-12</a><p>* <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;UTF-16" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;UTF-16</a><p>The original spec had 31 bits (the UTF-32&#x2F;UCS-4 range):<p>* <a href="https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;rfc2279" rel="nofollow">https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;rfc2279</a><p>* <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;UTF-32" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;UTF-32</a>
    • flohofwoe9 hours ago
      &gt; ...24-bit numbers?<p>Technically current UTF-8 only goes up to 21 bits (that&#x27;s the current UNICODE range), for the encoding itself that is an arbitrary limit though, with the &#x27;single lead byte&#x27; method of traditional UTF-8 it could go up to 36 bits &quot;payload&quot;.
    • sharktheone4 hours ago
      I think that wouldn&#x27;t change much. They would just make use of more grapheme clusters.<p>For emojies they already make heavy use of the Zero-Width-Joiner. So a woman firefighter is the woman emoji + ZWJ + fire engine. Sure the UTF-8000 approach is much better encoding size wise.
      • mitxela4 hours ago
        I wonder how they&#x27;re going to encode a female fire engine in the future.
        • Dylan168071 hour ago
          No worries, that would use female sign, not woman.
  • mqus7 hours ago
    Some ideas of what to do with this space:<p>- fully-customizable emojis (think of a RPG-like character customization screen)<p>- heck, why not full jpegs&#x2F;gifs?<p>- some unicode programming script (running Doom)<p>- ?<p>That said, some very minor (HN-style) nitpick:<p>&gt; Otherwise for an n byte code unit this is (5n+1) &#x2F; 8n, that is 5n+1 content bits out of a total of 8n bits from n bytes. We can rewrite this as (5&#x2F;8) + 1&#x2F;(8n) which moderately quickly approaches 5&#x2F;8 = 62.5%. It is nice that this limit is nonzero and does not depend on n.<p>Isn&#x27;t a limit by definition no longer dependent on n?
    • jeroenhd7 hours ago
      U+E000–U+F8FF, U+F0000–U+FFFFD, and U+100000–U+10FFFD can already provide you with your own emoji, as that range has been reserved for private use. Extending the range further might make sense if you need even more space in your program, but that&#x27;s a lot of space already.
      • mqus7 hours ago
        2-3 bytes are not much space for anything. Sure, you could use multiple successive ones of these code points and define your own &quot;continuation&quot; encoding in these ranges, but that doesn&#x27;t seem right to me somehow
        • flohofwoe2 hours ago
          That combination is how it already works. You can build combined &quot;characters&quot; (grapheme clusters) from multiple code points, e.g. you could have a &quot;base emoji&quot; followed by a &quot;modifier&quot; emoji, and AFAIK that&#x27;s how emojis with different skin colors work (one code point for the base emoji (e.g. &#x27;thumbs up&#x27;), and a number of skin color modification code points which can be applied to all emojis that involve skin color.
      • grumbelbart7 hours ago
        The point is probably to encode the emoji (image) in the codepoint itself.
    • xg157 hours ago
      &gt; <i>some unicode programming script (running Doom)</i><p>I agree with you that Unicode urgently needs a scripting capability (*), but my plan was to just implement it using invisible tag characters [1] or something like that - but of course allowing a script to be written <i>in a single codepoint</i> is the much more elegant solution.<p>It also neatly solves the problem of how to write Unicode strings inside scripts inside Unicode strings and also scripts inside Unicode strings inside scripts inside Unicode strings.<p>(*) in RFC 04-01-2027<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tags_(Unicode_block)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tags_(Unicode_block)</a>
      • reaperducer3 hours ago
        <i>in RFC 04-01-2027</i><p>I, for one, welcome our new time-traveling overlords.
    • sph7 hours ago
      Another one: encode instructions on how to draw the glyph into the text itself. The string becomes both the text and the font. Why not make it turing complete and as powerful&#x2F;complex as TTF.
    • amelius6 hours ago
      Imagine someone using the same fully customized emoji multiple times in the same text. Seems like a waste of space. Maybe better to encode just a UUID, and send the image codebook separately.
    • mqus7 hours ago
      One more idea:<p>- Unicode-as-a-character, meaning: a whole text displayed as if it were one character, made for infinite zooming
  • Sharlin8 hours ago
    UTF-8 originally supported up to six-byte encodings (see eg. RFC 2279), but it was restricted to four bytes in 2003 in order to match UTF-16 constraints :(
    • delamon8 hours ago
      We still have about 85% of codepoint space unused. Hopefully, by the time it becomes a problem, UTF-16 will be long dead
      • nasso_dev8 hours ago
        i hope so too, but UTF-16 being used by languages such as java and javascript makes me fear it might be here to stay.... i hope im wrong
        • 7bit2 hours ago
          Utf-16 is famously used by Windows for everything important as well.
        • hnlmorg7 hours ago
          The number of glyphs available by adding additional bytes drops exponentially because each subsequent byte has one less bit available.<p>So I think if we ever were in a situation where &gt; 1 million code points isn’t enough, then we should look at an entirely new way to serialise those code points.
          • delamon6 hours ago
            I don&#x27;t quite get it. 5-byte utf-8 encoding gets extra 5 bits compared to 4 byte, and 6-byte gets extra 10 bits. If you were thinking about bits in leading byte, then yes, you are losing one bit for every extra trailing byte, but you also get 6 bits from it. So adding a byte gives you extra 5 bits.
            • hnlmorg6 hours ago
              Yeah, you’re right. I might have attempted to do mental arithmetic before coffee…
  • stbenjam5 hours ago
    &gt; No special cases introduced. All properties preserved.<p>I don’t actually know if this is LLM-generated, but phrasing like this is weirdly triggering to me now
    • Neywiny5 hours ago
      Yeah that kind of line is what I see all the time in my chats. Even worse worse is when they put it in code comments.
  • yyyk8 hours ago
    Just limit it to 8 bytes at which point you always do &#x27;know the number of follow on bytes&#x27; from the first byte.<p>Nobody needs more than 4.47 trillion characters. (famous last words)
    • mitxela4 hours ago
      Important to recognize that <i>characters</i> have individuality, that&#x27;s why there can only be a limited number of them. Unicode is enumerating a finite set of things, not encoding an infinite set. Aenything without this property - any generic form of encoding - is not characters, it&#x27;s something else like images. If it&#x27;s not in any alphabet it shouldn&#x27;t be in unicode, you should use an escape tag for image data instead. (Emojis probably shouldn&#x27;t, but they do behave like an alphabet)<p>There cannot be 4 trillion characters because humans would need to know all of them and humans cannot know that many things.
  • achille9 hours ago
    &gt; Ken Thompson: &quot;...i really dont think it is useful. it is like replacing ipv6 with ipv50&quot;
    • mitxela4 hours ago
      256-bit addresses would be long enough proper cryptographic addressing. (128 is barely not enough due to how they&#x27;re allocated)<p>512 would also for cryptographic addresses within cryptographic subnets (or 3 128-bit layers plus some extra bits), and 1024 would allow for up to 7 layers. It&#x27;s not a completely silly idea.<p>Yggdrasil subnet addresses only have 56 bits of cryptographic entropy; there&#x27;s a limited workaround where you increase work by searching for one with a zero prefix, but the cost to clone one can&#x27;t be more than 2^56 times the cost to create it, which isn&#x27;t adequate in cryptography. Individual addresses can also be created with 112 bits of entropy, which is barely adequate. That&#x27;s why I say 128 bits total isn&#x27;t enough for cryptography plus subnetting.
  • tescreal1 hour ago
    On the naming issue with a &quot;UTF-8&quot; prefix, I suggest &quot;UTF+8&quot; which puns earlier in the string for a double effect. Fun paper!
  • Dwedit9 hours ago
    FF bytes are an easy way to identify an invalid UTF-8 file. This idea doesn&#x27;t have that property.
    • sph9 hours ago
      True, but not all non-UTF8 bytestrings contain 0xFF bytes, so it’s not very useful in practice.
      • da_chicken8 hours ago
        Yes, I agree.<p>It&#x27;s more common for programs that say they support UTF-8 to not really do so at all. It wasn&#x27;t that long ago that &quot;UTF-8&quot; support was often just single byte, so it was little more than ASCII. Even now it&#x27;s common for programs to choke on the optional BOM. Yes, it is redundant, congratulations. The spec still explicitly allows it. Three and four byte character support is still not the best, too.
        • flohofwoe8 hours ago
          &gt; &quot;UTF-8&quot; support was often just single byte, so it was little more than ASCII<p>&quot;Single byte UTF-8&quot; <i>is</i> ASCII. That&#x27;s one of its most important properties.<p>&gt; Even now it&#x27;s common for programs to choke on the optional BOM<p>And they should... BOMs (and especially the hilarious UTF-8 BOM) are strictly a legacy Microsoft&#x2F;Windows thing and should be abolished along with &quot;extended&quot; 8-bit ASCII encodings and UCS-2&#x2F;UTF-16 (only UTF-32 makes sense, but should only be used at runtime to allow random access on UNICODE code points, but not for data exchange.
          • da_chicken3 hours ago
            Your opinion on the BOM isn&#x27;t wrong, but it&#x27;s also not germaine to whether or not you&#x27;re actually following the spec. The spec is the spec. If you don&#x27;t like it you can get the spec changed. You don&#x27;t get to ignore the spec and then claim support. That&#x27;s not how standards work. &quot;I don&#x27;t like it,&quot; isn&#x27;t a good explanation.<p>Otherwise I&#x27;d be inclined to fix the spelling error in the HTTP referrer.
          • entrope5 hours ago
            &gt; BOMs (and especially the hilarious UTF-8 BOM) are strictly a legacy Microsoft&#x2F;Windows thing<p>How should a reader infer the bye order for a UCS-2 or UTF-16 file without a BOM? It seems like one would have to read until finding a code point that would be illegal under one ordering (but files might not include such a code point).<p>Similarly, a UTF-8 BOM is a useful flag to distinguish UTF-8 from other text encodings. You are right that the ambiguity goes away if those other encodings do, but people don&#x27;t want to rewrite their legacy files. Some people don&#x27;t want to use two bytes for common non-ASCII characters, so they are really attached to ISO-8859 or Windows-1252 or koi8r or whatever. CJK languages have their own encodings that are more efficient for their languages. UTF-8 is great for English speakers, but it&#x27;s a compromise for everyone else, so they might reasonably want incompatible systems for their own use. UTF-8 BOM is a good &quot;magic&quot; sequence to detect encoding as long as people have non-UTF-8 files.
            • flohofwoe2 hours ago
              &gt; How should a reader infer the bye order for a UCS-2 or UTF-16 file without a BOM?<p>Simple: switch to UTF-8 as the only encoding standard for sharing text data, keep UTF-32 as &#x27;internal&#x27; runtime format for random access to codepoints, and get rid of all other legacy encodings (UCS-2, UTF-16, Extended ASCII with code pages, and all the other region specific encodings that popped up in the 70s and 80s because UTF-8 wasn&#x27;t invented yet.<p>This general switch to UTF-8 should have happend in the mid-to-late 1990s (e.g. together with the web becoming popular), and Microsoft alone is to blame for dragging this shit along for the next three decades. If all Microsoft tools would only save text data as UTF-8 starting by the end of the last century, but still support reading all sorts of encodings for a decade or so, the transition would have been finished by 2010. Alas, that never happened.<p>And tbh, the file size argument for alphabets that don&#x27;t fit into 7-bit ASCII doesn&#x27;t really make sense anymore today where images and videos make up the vast majority of data volume.
    • flohofwoe9 hours ago
      It&#x27;s still a joy to see how frigging elegant and extensible the UTF-8 specification is. And even without the esoteric 0xFF lead byte, the regular UTF-8 encoding with a 0xFE lead byte (11111110) would still have plenty of headroom (36 bits) compared to the current 21 bits for UNICODE.
    • beeforpork8 hours ago
      As are FE, FD, FC, FB, FA, F9, F8, F7, F6 and F5.
  • rsanheim8 hours ago
    This is like TIME CUBE (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Time_Cube" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Time_Cube</a>) but for encoding nerds.<p>edit: replaced false prophet site with wiki link for the original one and true timecube.com...lost to the sands of ...time.
    • sph7 hours ago
      timecube.com is lost, zombo.com has been redesigned. If this is not proof of a dead internet, I don’t know what is.
  • lukasgelbmann7 hours ago
    Self-synchronization in UTF-8 is intuitively a great thing to have, yet I don’t remember actively relying on it ever. Does anyone have a good example of when it‘s useful?<p>Another related nice property that UTF-8 has: substring search reduces to bytestring substring search. I.e. given two Unicode strings in UTF-8 encoding, you can check if one is a substring of the other by just treating them as bytestrings and checking if one bytestring is a substring of the other bytestring. This is a stronger property than self-synchronization: UTF-8 has it, but UTF-8000 doesn’t.
    • layer81 hour ago
      &gt; Does anyone have a good example of when it‘s useful?<p>It prevents vulnerabilities where an incorrect offset into a string could result in characters being read that aren’t in the original string (which could defeat a prior sanitization of the string).
    • conradludgate6 hours ago
      Rely on it? Not that I can remember.<p>However, Rust makes use of it for fast safety checks. Because rust strings must be valid utf8, if you want to take a substring at some range, eg &quot;Hello, World!&quot;[7..12] then it&#x27;s very simple to just check bytes 7 and 12 and see if they are the start of a codepoint, no other scanning or parsing is required.
    • tjjfvi5 hours ago
      I don’t see how UTF-8000 doesn’t have it. The first byte of any code point is either 0xxxxxxx or 10xxxxxxx, which is distinct from all non-first bytes which are 11xxxxxx. Thus any UTF-8000 sub-bytestring must necessarily have the start aligned at a code point boundary, at which point all the subsequent bytes are interpreted as codepoints in the same way.
      • lukasgelbmann2 hours ago
        Right, UTF-8000 does have this property. Too late to edit my comment now, thanks for noticing that.
    • hippietrail6 hours ago
      Only if they&#x27;ve already both undergone normalization to NFC or NFD.
  • avadodin6 hours ago
    IIRC UTF-8 proposal used to go to 6 bytes as they already felt that not having part of the code point in the first byte was an issue somehow.<p>I think at least 7 should be allowed. 42 bits could contain all sorts of information.<p>&quot;UTF-8000&quot; is still ANSI-safe and although it loses some of the properties such as a header code only appearing once in a byte sequence, it is perfectly viable to encode arbitrarily sized unsigned integers.
  • imhoguy5 hours ago
    Alright, so now we can fit an entire LLM model into one character.
  • lifthrasiir7 hours ago
    I was about to immediately suggest UCS-X, and then pleased that the author offers a fair comparison to UCS-X and many other alternatives. Great. Too bad UCS-X is possibly more memorable name.
  • jibal8 hours ago
    The letter from Ken Thompson is spot on:<p>&quot;your first 2 extensions (5 and 6 bytes) were clearly envisioned. the standard (up to 4 bytes) was created to cover the size of unicode. i thought any more description would be a waste of paper. i think your extension from 7 to 8 bytes is a little hoaky. i requires reading the whole string rather than &quot;knowing&quot; the number of follow on bytes. so, i think the only thing new is the 7 byte version.<p>i appreciate the mail, but i really dont think it is useful. it is like replacing ipv6 with ipv50.&quot;
  • etatoby6 hours ago
    Finally, an ASCII-safe way to encode all the vectors of Neuralese.
  • mrlonglong9 hours ago
    I love it.<p>Some day we&#x27;ll need this when we finally realise we are not alone in the universe. Alien glyphs ftw.
  • flohofwoe9 hours ago
    Phew, and I was worried that we&#x27;d be running out of UNICODE space for new emojis ;)
  • beeforpork8 hours ago
    It would be nice if the first paragraph gave a motivation for this. Why did you start this?<p>I mean, I can derive from the text that this can encode arbitrarily large integers. So what? What&#x27;s the point? I also understand that this is for fun.
    • conradludgate5 hours ago
      &gt; This is a fun standalone project &#x2F; proposal
      • beeforpork5 hours ago
        Yes, sure. But what was the incentive? The goal? The reason to start the project (and not another one)? What was interesting enough to start this?
  • OutOfHere3 hours ago
    Perhaps we can use a generalized Unicode-like encoding space for LLM text tokens. A text tokenization scheme uses up a few hundred thousand entries, with say one thousand new entries added annually. These can be called amojis, meaning AI mojis.
  • snvzz9 hours ago
    No project is ever safe from complicators.<p>This is why we need the KISS enforcers.
    • flohofwoe8 hours ago
      But the nice thing about UTF-8 is that this proposal isn&#x27;t really a &quot;complication&quot;, but a minimal and natural extension of the original idea to allow more than one lead byte.
      • entrope5 hours ago
        Allowing more than one lead byte <i>is</i> a complication of the existing standard. As many others have pointed out, we have plenty of coding space without that (e.g. by allowing 5- and 6-byte UTF-8 again), so the case for the extra complexity is currently not compelling.
      • snvzz1 hour ago
        It starts like this, and ends up like x86.
  • Grimeton9 hours ago
    More like WTF-8.<p><a href="https:&#x2F;&#x2F;xkcd.com&#x2F;1953&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;1953&#x2F;</a>
    • Sharlin9 hours ago
      No, WTF-8 is its own encoding: <a href="https:&#x2F;&#x2F;wtf-8.codeberg.page&#x2F;" rel="nofollow">https:&#x2F;&#x2F;wtf-8.codeberg.page&#x2F;</a>