[mercury-users] Mercury programmer required ;-)

Peter Schachte pets at cs.mu.OZ.AU
Fri Sep 25 23:23:50 AEST 1998


On Fri, Sep 25, 1998 at 02:44:59PM +0200, Juergen Stuber wrote:
> This would break already in ISO 8859-1 if is_alpha/1
> and to_upper/2 were extended to accented letters or umlauts.

What do you mean by "break"?  What do you expect rot13 to do to
accented letters?  What do you expect, say, e umlaut to turn into?
Rot13 is only defined to change the unaccented letters.  If you want
accented letters to turn into the accented rot13'ed letter you're
going to be out of luck, because most of them won't be in the
character set.  You could hash up the accented characters somehow, but
rot13 isn't an appropriate function because there are about 62
accented characters.  Maybe a sensible function would replace
characters between 192 and 255 with 255 - n + 192:  at least that
function is its own inverse.  But this isn't very portable either.

Aside from the assumption that the upper and lower case letters are
each numbered contiguously, I think my implementation is about as
portable as you are going to get.


-- 
Peter Schachte                | What we cannot speak about we must pass over
mailto:pets at cs.mu.OZ.AU       | in silence.
http://www.cs.mu.oz.au/~pets/ |     -- Wittgenstein 
PGP: finger pets at 128.250.37.3 | 



More information about the users mailing list