r/Unicode • • 8d ago

Alternatives to Unicode?

For a whole lot of things unicode works perfectly fine, has basically all of the scripts that are actively being used, minus a couple really niche ones, but those can get added at some point. If people need custom symbols for things they can use the giant private use area things with a custom font, it works.

On the off chance you're in some situation where you need to write some amount of "text" in such a way that Unicode can't help with, is there even an alternative? Unicode WAS made to be the unifying standard of text for computers, so there's no reason to have alternatives... but there has to be some random crackhead who TRIED, right? What would that even be called?

19 Upvotes

46 comments sorted by

8

u/Emotional-Ebb8321 8d ago

As a real-world use-case, gaiji (kanji that aren't formally encoded in unicode or other schemes) are done as small inline svg images, and these images are then placed as if they were part of the text string.

3

u/Kermit_the_hog 8d ago

That sounds disastrous to try to implement in a terminal or anything but the web. 

I’m imagining some kind of svg to sixel rendering pipeline.. but then that’s un-editable. 

4

u/Emotional-Ebb8321 8d ago

If you think about it, a unicode font is just a predefined set of escape codes for a collection of inline svg images.

2

u/Kermit_the_hog 8d ago

If only we were allowed to tinker with things more openly within the rendering pipeline.. but I think that would supposedly create infinite security issues or something. 

Best we get is maybe some limited support for a strictly limited set of approved combining characters. 

Things like Windows terminal deliberately won’t even expose fallback without a lot of registry hacking for security purposes. So it’s custom patched fonts for everyone!

2

u/HTFCirno2000 7d ago

i mean TECHNICALLY some terminals let you embed images or even use custom sprites

6

u/red_hare 8d ago

Unicode is two things:

  1. A list of every symbol we know of in history
  2. A set of encoding strategies (UTF-8, UTF-16, UTF-32) that maps symbols in that list to binary.

The question I have is which problem are you trying to solve? As you said, there's a solution for (1) by extending the list. But there are probably loads of valid needs for (2), specific encodings that work on a subset of the list.

For (2) there's a rich history of other standards that cover subsets of the list. ASCII, Latin-1, ShiftJIS, etc.

There are also some unique entries that don't map to the list exactly. The original Pokemon games had their own encoding that did things like have "PK" and "MN" symbols so "PKMN" could be expressed in two bytes. Or have dedicated control characters that inserted the the characters name.

As for modern examples of encodings. Take a look at LLMs. The first step of tokenization with BPE effectively does an intelligent (more compressed across all text) form of what UTF-8 does.

3

u/frnzprf 7d ago

The pokemon thing is interesting, or if you invented your own fantasy script like Elvish or Klingon.

Then you would need to decide which numbers encode which fantasy characters and patch an existing text-renderer, so it can display these new characters.

3

u/zeekar 7d ago

There's a region of Unicode space reserved for private use, which has been unofficially divided up among various conlang scripts, including Elvish (Tengwar) and Klingon (pIqaD).

2

u/saxbophone 7d ago

I wonder if that script specifically for Lojban has also joined this party..?

1

u/zeekar 7d ago

The featural abjad? I don't see it in the list on that page.

3

u/PressureBeautiful515 7d ago

The problem they are trying to solve is that of having something to talk about

4

u/frozenpandaman 8d ago

SHIFT_JIS /s

1

u/flatfinger 8d ago

One problem with Unicode is that it uses the same representation for text that is being edited as it uses for text at rest. Shift JIS, from what I understand, is a bad format for text that is being edited, but more compact than Unicode for text at rest.

1

u/nacaclanga 7d ago

My understanding is that Shift JIS is mostly still used because it accertains a Japanese shape of characters and uses two bytes instead of 3 for Japanese characters.

It is an absolute terrible encoding through because not only is it not self synchonising, it also reuses ASCII code bytes as second codebytes for multi character ranges.

Finally there is the inabiguity about \ vs ¥ in the encoding.

1

u/steffahn 6d ago

In case you want shifting, but also Unicode, try SCSU as an encoding :-)

For it, too, the limited support nowadays (in particular it's usable on the web) - among other things - comes down to repurposing ASCII ranges (including control bytes).

0

u/zeekar 7d ago

As it turns out, "more compact than Unicode" for Japanese is not a high bar to clear. Kana and most kanji take three bytes each in UTF-8, and if you need to reach into the higher regions outside the main CJK block that goes up to four even in UTF-16.

7

u/nemothorx 8d ago

Closest I can think of is https://en.wikipedia.org/wiki/UTF-EBCDIC

Realistically, unicode succeeded. It unified text and everything modern with even a scrap of deployment uses it, or a subset of it (at an extreme, that subset might be "the original ascii bits")

5

u/nacaclanga 8d ago

Isn't UTF-EBCDIC just an unicode transfer format that aims to be EBCDIC compatible, similarly to how UTF8 is for ASCII.

3

u/regular_hammock 8d ago

Transformation format but yes, that.

Bonus fun fact: EBCDIC isn't a single character encoding, it's a whole cursed family of character encodings. They're probably easy enough to tell apart for those in the know, but for little weenies like myself, half of the time the EBCDIC file you're parsing turns out to be encoded in another slightly different variant than the one you were expecting.

2

u/robthablob 7d ago

To be fair, that was true for ANSI character encodings too, which all seemed to use different supersets of ASCII.

1

u/regular_hammock 5d ago

Totally fair. It's just that I was familiar enough with code pages to expect them to bite me in the ass, whereas I had unreasonable expectations of EBCDIC.

1

u/robthablob 5d ago

I also used AS/400 for a while, so I know the pain.

3

u/amake 8d ago edited 8d ago

ITT: People confusing encoding with character sets

Are you trying to encode text in an encoding other than a Unicode encoding (UTF-{8,16,32})? There are tons of alternative encodings for other character sets; pretty much by definition none of them will have the breadth of characters that Unicode has.

Are you trying to work with characters outside of the Unicode character set? If so, those characters may be eligible for inclusion in Unicode. Otherwise you can map them to PUA code points; you’ll be responsible for supplying an appropriate font everywhere you want to use them.

Edit: Re-reading the post, it’s clear that you know about PUA but it’s not at all clear what you are trying to achieve. What does it mean for Unicode to not be able to “help” with something?

1

u/C_Plot 8d ago

What if you need 65 levels of bidi embedding? 😊

2

u/zoharel 7d ago

What would that even be called?

Multicode. If it existed, it would be called multicode.

2

u/Robot_Graffiti 7d ago

Unicode is designed to never need an alternative.

If a piece of text can be described as a stream of numbers, you can do it with the Unicode private use areas and a custom font.

If it can't be described as a stream of numbers, it can't be stored in a text file.

The only exception I can think of is that Unicode will need to be modified slightly if we ever have 3 times the number of characters that have ever been used in any alphabet in history so far. Like for example if we meet aliens and the Galactic Federation uses a bunch of Chinese-like writing systems.

3

u/elperroborrachotoo 8d ago

CJK and, of course, code pages. And, of double course, ASCII.

Generally, the amount of sensible alternatives is determined by the amount of reasonable restrictions. Unicode is intended to be universal, that drives complexity. If we can reduce the problem at hand to a less complex task, we get competing standards and simpler solutions.

1

u/A1oso 7d ago

CJK isn't a Unicode alternative. It's just a word that means "Chinese, Japanese or Korean". It's not a character set or encoding.

1

u/nacaclanga 8d ago edited 8d ago

There are a few projects which do, usually because of certain Unicode policies that prove somehow problematic in certain areas. Usually they try to stick to Unicode for the most part through

  • Han Unification: Many Han characters have prefered shapes in certain areas. In particular Japanese and Chinese shapes differ (simplified and traditional chinese characters are usually different by encoding) and in practise applications use a region schema to distinglish, which is kind of the old regional encodings in new cloths. In theory this could be fixed with rigerous variant selector usage. The Tron encoding was a proposed to work around this.
  • Historic lettershapes: Unicode does not provide codepoints for ligatures. In some cases this is a problem. In theory ligatures could be encoded with the zero widht joiner although this is never done. MFUI and UNZ1 are Unicode extentions that work around this.
  • Conscripts: Unicode has some policy against conscripts. While this is not fully consistent, even very popular ones like Tolkien's Tengwar are not included into it.

There are certainly also areas where unicode could be improved, but afaik this isn't worth defining an Unicode revision of some kind.

1

u/flatfinger 8d ago

Another bad Unicode design decision was the Turkish "i". More broadly, the Unicode Consortium failed to recognize that the process of rendering text involves multiple OSI layers, which may need texts to be normalized in different ways that might not necessarily support round-tripping. There should, for example, be a normalization form that would allow an application to render text containing grapheme clusters and bidirectional text without the application itself having to understand such things. A form intended for text rendering could e.g. strip certain control codes (e.g. ASCII codes 28-31 ) and then convert the text to a sequence of words separated by code 31, with each word starting with either 28 or 29 depending upon whether the characters should be shown left to right or right to left, and with the grapheme clusters within each word separated by 30. If an OS supplied a function to convert a text string to such a form, and functions to measure or render text strings that start with a 28 or 29, a text layout engine could take a text containing any arbitrary combination of bidirectional text and grapheme clusters that are understood by the OS, and render it properly even if the text contained features that the application itself knew nothing about.

0

u/PiotrGrochowski 7d ago

Even if the grapheme clusters and bidirectional runs were made explicit, the renderer would still need to have specific support for bidirectional rendering (handling nested bidirectional runs is the hard part) and complex script shaping (such as combining diacritic alignment and ligatures, which are inherently font dependent). In most cases this cannot be used to fill in missing features in the renderer.

1

u/flatfinger 7d ago

A form that's normalized for rendering shouldn't have any nested birectional runs, but should instead be decomposed into a sequence of unidirectional runs. An OS-supplied renderer would need to know how to combine glyphs, but the middle application layers shouldn't.

1

u/PiotrGrochowski 7d ago

There is no way to decompose nested bidirectional runs into a 'sequence of unidirectional runs' because the relative position of inner runs may vary depending on the direction of the outer runs. The 'OS-supplied renderer' is still a software dependency, as soon as the application is ported to an embedded platform, it will need to implement the features separately.

1

u/flatfinger 7d ago

The bottom level normalization function should convert text to a sequence of unidirectional chunks that would, depending upon the particular normalization form, etiher be in right-to-left or left-to-right order (and may thus contain text in a different sequence from the original). Setting a paragraph would require breaking text that is in semantic order into lines, and then rearranging the compoments of each line into placement order. The outer layer may need to support nesting context markers, but those need to be recognized as having character codes that are part of the Unicode character set, but having semantics that are defined at a higher level, and the OS should provide a primitive for doing text insertions in a manner that would guarantee that any context which is begun within the inserted text will be ended within the inserted text.

1

u/PiotrGrochowski 7d ago

Disrupting logical order like that would cause many issues such as inconsistent substrings between original and normalized text, incorrect order of all kinds of sequential text processing, and complex script features across bidirectional runs being processed incorrectly. To resolve those issues it would then end up with a system more complicated than processing the actual Unicode text directly in logical order.

1

u/flatfinger 7d ago

The described normalized forms would be specified as not preserving semantics and thus not being suitable for round-trip conversion. If you want to use some adjective other than "normalized" to describe the decomposition of text into a sequence of unidirectional extents, I'm hardly attached to that word, but if systems are going to provide upgradable facilities for handling new constructs, there needs to be a standardized "black box" that can be asked to decompose text into chunks that can be independently fed to a text renderer.

The notion of "processing the actual Unicode text directly in logical order" will be impossible if the text contains any features that were added after the application was written. By contrast, given a defined primitive operation to take a text and convert it into a sequence of unidirectional extents, an application could divide the text into chunks that could be passed to its "measure text" and "convert text to strokes" functions without the application needing to care about why things were grouped as they were.

1

u/PiotrGrochowski 7d ago

The logical order does not depend on complex shaping features that the text contains. If the application outsources all the rendering functions to the operating system anyway then what's even the point of dividing the text into chunks?

1

u/flatfinger 7d ago

If the application is supposed to e.g. format text to fit a shape, it needs to be able to subdivide the text into pieces that can be placed independently.

1

u/WillC5 8d ago

(Leeloo Dallas) Multicode?

1

u/bothunter 7d ago

Unicode is a massive global project to come up with a encoding standard for all of the world's languages, including past, present, and future. The alternative to it is to use the previous mess of various and incompatible code pages and encoding standards.

Are you trying to solve a particular problem, or is this just to satisfy your curiosity?

1

u/didntplaymysummercar 7d ago

TRON code of the TRON project?

1

u/LeonNeller2022 6d ago

Make your own unicode

1

u/Difficult-Value-3145 5d ago

ASCII American standard code for information interchange 7 bit character codes for the English language .and still works on pretty much everything the first 128 Unicode characters match th ASCII 128 as it predated Unicode idk that what ya mean

-2

u/BasilWeekly 8d ago

Punycode