‹ BackHN Continuity

Thread

UTF-8000: Unlimited UTF-8

134 points · 122 comments · vismit2000

  1. sph · · focus · HN ↗
    > UTF-8000 is in no way endorsed by or representative of the Unicode Consortium.

    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.

    Someone at the consortium is rubbing their hands with glee with all the newfound space.

    But honestly, cool hack! If you invent a method to encode large numbers into bytes, why limit yourself to 24-bit numbers?

    1. flohofwoe · · focus · HN ↗
      > ...24-bit numbers?

      Technically current UTF-8 only goes up to 21 bits (that's the current UNICODE range), for the encoding itself that is an arbitrary limit though, with the 'single lead byte' method of traditional UTF-8 it could go up to 36 bits "payload".

    2. throw0101a · · focus · HN ↗
      > […] why limit yourself to 24-bit numbers?

      For compatibility with UTF-16:

          o  Restricted the range of characters to 0000-10FFFF (the UTF-16
             accessible range).
      
      * <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 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

      The original spec had 31 bits (the UTF-32&#x2F;UCS-4 range):

      * <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 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

      1. orangeboats · · focus · HN ↗
        We really ought to deprecate UTF-16 someday. The fact that it pretends to be a fixed-length encoding has caused all sorts of bugs over the years, with many people assuming n(UTF-16 codepoints) == n(characters) which breaks when the string contains non-BMP characters.

        And also, for personal aesthetic reasons I hate that it limits the Unicode codepoint range to an awkward non-power-of-two number (now there are 0x110000 codepoints in total). UTF-8 and UTF-32&#x27;s 2^31 feels much more natural.

        1. bjoli · · focus · HN ↗
          I wonder what it would take. For things like Java, JSA, and c# there would have to be things like a parallel utf8 api (yes please), but the really hard parts is the things that are as old as time (windows).

          I don&#x27;t think it will ever happen, but one can dream.

    3. sharktheone · · focus · HN ↗
      I think that wouldn&#x27;t change much. They would just make use of more grapheme clusters.

      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.

      1. mitxela · · focus · HN ↗
        I wonder how they&#x27;re going to encode a female fire engine in the future.
        1. Dylan16807 · · focus · HN ↗
          No worries, that would use female sign, not woman.
        2. sharktheone · · focus · HN ↗
          I don&#x27;t understand why you are saying this. That just seems a bit inappropriate
          1. mitxela · · focus · HN ↗
            It&#x27;s a joke based on the construction of emojis? Female plus fire engine obviously denotes a female fire engine but has apparently been repurposed as a female firefighter instead
    4. TeMPOraL · · focus · HN ↗
      I predict eventual convergence between UTF-whatever and most popular tokenizer for whatever LLM escapes to become world-ruling AGI.

      I mean, if someone&#x27;s seriously going to try encoding birdsong and dog barks, at this point they&#x27;re basically reinventing tokens for multi-modal language models.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.