[patch] scp + UTF-8

Carson Gaspar carson at taltos.org
Wed Jan 20 13:31:44 AEDT 2016


On 1/19/16 3:54 PM, Ingo Schwarze wrote:
> that puts ASCII in the range 0x00 to 0x7f.  Using iswprint(3)
> is not a very good idea either because that is C99, not C89,
> and may not be available either.

iswprint() is SUSv3/POSIX.1-2001 as well as C99. So is wcwidth(). So the 
odds are if you have one, you have the other.

Historical perspective:
Solaris 2.5 (1995) had support for both in libw
Solaris 2.6 (1997) moved them to libc
Visual Studio 6 (1998) had support, possibly earlier versions
Red Hat Linux in 6.0 (1999)
NetBSD appears to have added it in 1.6 (2002)
FreeBSD in 5.0 (2003)
Mac OS X in 10.3 (2003)
Minix only got them with the 3.2.x NetBSD userland (2012?)

I got tired of looking up specific versions, but late enough IRIX, HPUX, 
OpenVMS, Tru64, OSF1, VxWorks, and QNX Neutrino all support them.

ULTRIX never did.

Which platforms does the project care about that _don't_ support them?

For non-supporting platforms, GNU Gettext just does:

iswprint (__wctype_wint_t wc)
{
   return wc >= ' ' && wc <= '~';
}

Glibc has some bit-shifting voodoo that does iswprint for UTF-8 only - 
the code is simple enough to re-implement.

A full locale-aware version is a lot of work :-(



More information about the openssh-unix-dev mailing list