emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting a string to valid XHTML id?


From: Davis Herring
Subject: Re: Converting a string to valid XHTML id?
Date: Wed, 1 Dec 2010 17:18:55 -0800 (PST)
User-agent: SquirrelMail/1.4.8-5.el5_4.10.lanl3

> I don't understand how your version is supposed to work. How can it be
> unique if it does not keep track of if the id is already used? (Or did
> you say that this case is not covered?)

The requirement is that unique inputs map to unique outputs, yes?  What I
wrote does that, by making the string longer when it contains characters
that can't be used directly.  It's a standard thing: map the strings in
A^n onto B^(n+e), where B is a smaller alphabet than A and e is the extra
length required because each letter conveys less information.  (In
particular, it must be that |A|^n<=|B|^(n+e) for any such injective
coding.)  Like base64 or uuencode or quoted-printable.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]