Adding unicode support to write

In Unix, there's a write command that lets you send messages to other users logged in to the system. In Debian, a version of this command is included in the bsdmainutils package. I'm lucky enough to know people that like to communicate with me this way.

It's a known bug that write only supports the basic characters that are part of ascii. So you can't use all the characters of different languages like Danish or Spanish.

The write utility does not recognize multibyte characters.

—from write's man page

You can fix this by changing the character buffer to use a multi-byte type instead of the old-school 8-bit char. Details are here.

There are still some improvements that I need to make with this patch. wchar_t isn't ideal for UTF-8 data, though it works. Apparently it's better (i.e. possibly more portable in the long run) to use char16_t or char32_t, including uchar.h instead of wchar.h. https://stackoverflow.com/a/527307/173630 Also, I need to investigate some interactions between this patch and how it's displayed over ssh when you're connecting through Mac OS X.