SQLite Forum

.mode box does not seem to like UTF-8
Login
> don't they sometimes add new characters into Unicode?

Yes, which is why libraries like iconv and ICU get updated every time a new version of Unicode is published. If you try to feed Unicode 12 data to a machine running Unicode 8 libraries, you can expect failures. I don’t see how that’s any different from any other common data format versioning case, though.

> you might want characters which aren't in Unicode

Such as...?

> some characters have an ambiguous width,

I don’t know about that. I think it’s more the case that this varies by font, and a terminal based program cannot reliably know what font the terminal is using. It can hard-code guesses and heuristics, but it can never be certain. This is the real reason you will never find a general solution to this problem.

If you have to solve it, you need to move to a medium where you can programmatically ask questions like,  “How long is this string when rendered in *this specific font*?” (e.g. HTML rendered in a browser, as recommended previously in this thread.)

>  My own solution is to not use Unicode

Yay provincialism!

> some people will use Unicode anyways

You’re using it right now. You just aren’t using every character Unicode defines.