It was pointed out to me that my implementation of chartorune() was braindead, and I can only agree, and I've since also discovered that my implementation of fullrune() was lacking, to such a degree that it was just plain wrong. Apologies, as this hinders Alan Watson's wc from working correctly. I've also cleaned up a bug in utf_snprintf, which was also downright silly. The new versions have been uploaded to: http://www.westley.demon.co.uk/libutf-2.8.tar.gz http://www.westley.demon.co.uk/ssam-1.7.tar.gz although they're only visible from "close of business" (my ISP's words, not mine) today, 24th February, 17:00 GMT. As usual, the correct way to install the software is as follows: % tar xvzf libutf-2.8.tar.gz % cd libutf-2.8 % ./configure % make tst % make install % cd .. % tar xvzf ssam-1.7.tar.gz % cd ssam-1.7 % ./configure % make tst % make install A list of the changes appears at the end of this mail. This has been tested on UTS 4.3.2 (S390 mainframe), Solaris 2.4 (SS5), and NetBSD/i386 1.2C. Sorry about the bugs, Alistair ssam-1.7 changes + corrected spelling of Byron Rakitzis' name in ssam.1 manual page libutf-2.8 changes + added error checking to chartorune, at suggestion of Rob Pike (rob@plan9.bell-labs.com) - now recognise `error runes', and return the Runeerror character, with unity length. The previous code ignored error runes, and blindly gave them a length of 3 bytes, probably pushing the following runes in the string `out of sync'. Woops. + added a test for error runes + check for null expressions, which can cause gurep to coredump when dereferenced on some platforms e.g. Solaris. + added a test for null expressions given as args to gurep + corrected my implementation of fullrune(), which was just plain wrong. Shown up by testing Alan Watson's UTF-aware wc. + fixed a bug whereby I didn't zero-byte-terminate the buffer in utf_snprintf - this caused occasional "language not found" errors.