Hi David,

the DOS way of supporting charsets with more than 256 different
characters ws called DBCS and used only in Asian / CJK countries:

https://en.wikipedia.org/wiki/DBCS

This is not exactly UTF-8. Normally, DOS users configure their
system to use one (or switch between a few) 256 character code
pages (character sets). Of course software for DOS is free to
process more complex data internally, but DOS does not, generally
speaking.

You could make your software interpret UTF-8 internally and
convert to and from the currently active codepage using some
kind of Unicode look up tables. Displaying 1000s of different
characters simultaneously only works with graphics anyway,
but you can at least preserve UTF-8 and display the parts
which can be displayed in the current charset.

It would be interesting to test and implement various DBCS
things with FreeDOS: On top of that, you could implement I/O
libraries which translate between 16-bit DBCS and the parts
of Unicode which can be represented as UTF-16, for example,
with additional support for converting UTF-8 strings to and
from UTF-16 or DBCS.

For DOS as operating system kernel itself, Unicode basically
does not exist, but all applications for DOS are free to
interpret raw data under the assumtion of UTF-8, UTF-16 or
other Unicode encodings. For special cases such as long file
name support, the corresponding drivers already have special
approaches for handling a few Unicode characters beyond ASCII.

As said, for display, you will often need graphics anyway and
that will often mean that it only works within your application.

Regards, Eric

> I'm coordinating a bunch of updates to Frotz[1], including the DOS port.
> One of the big enhancements is UTF-8 support for input and output.

> This would allow effortless support for accented characters and alternate
> alphabets.  We've tested games written for Spanish (diacritical marks)
> and Russian (Cyrillic alphabet).

> So far, I've found absolutely nothing on doing UTF-8 IO on DOS.  Is this
> something that can be done without bogging down an original IBM PC?  How
> would I go about doing it?

> [1] Z-machine interpreter for Infocom games and others.
> See https://gitlab.com/DavidGriffith/frotz/



_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to