Aharon Robbins wrote: > that exclusive-ORing looks a little scary to me. It is derived from a coding hack that I picked up from Dijkstra back in the 1970s. He gave the most boring computer-science lecture I have ever attended -- so boring that Kit Fine walked out a few minutes into it -- but I stubbornly stayed through to the end and I've never forgotten the hack. The hack works everywhere, including platforms that use EBCDIC, shift-JIS, DBCS, etc., because it doesn't rely on the encoding scheme at all. Attached is a revised patch that adds some commentary and breaks the hack into some functions that I hope help explain things. Sorry, I don't know how to break this into smaller patches that would be easier to understand.