Hi,

Anthony J. Bentley wrote on Tue, Jul 11, 2017 at 02:58:08AM -0600:
> "Ted Unangst" writes:

>> do we want to delete them? or replace them with proper utf-8 sequences?

> I wouldn't mind doing that. But fortune(6) will happily print UTF-8 to a
> non-UTF-8 terminal, which though probably harmless might be undesirable.

Printing UTF-8 to a non-UTF-8 terminal - or more precisely, an
xterm(1) in "conventional 8bit mode", which is no longer the default
on OpenBSD, but which users can configure or request manually - is
*NOT* harmless.

In particular, the German SS ist very hostile.  It freezes the terminal.
Try

  $ xterm -u8  # This is the default on OpenBSD
  $ printf "Das Ma\xc3\x9f ist voll.\n"  # All is fine here.

Now try

  $ xterm +u8  # Not the default, and somewhat insecure.
  $ printf "Das Ma\xc3\x9f ist voll.\n"

Now that terminal is locked up.

I think using crap like gnome-terminal or konsole is irresponsible,
but i have been told that some users are unaware and use them anyway.
I have no idea what such programs do (by default or otherwise).


Even though our default xterm(1) configuration is robust enough
that it usually doesn't break anything, I'm not convinced
indiscriminately printing UTF-8 is a good idea.


This decade feels like a strange point in time for degrading fortune
and calendar files by replacing UTF-8 characters with ASCII
transcriptions.  Maybe such games should call

  setlocale(LC_CTYPE, "");
  char *loc = nl_langinfo(CODESET);

and replace bytes that are not printable ASCII with question marks
when loc doesn't contain UTF-8?  Not sure.

Yours,
  Ingo

Reply via email to