[Top][All Lists]

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

Re: Converting a string to valid XHTML id?

From: Lennart Borgman
Subject: Re: Converting a string to valid XHTML id?
Date: Thu, 2 Dec 2010 02:51:49 +0100

On Thu, Dec 2, 2010 at 2:18 AM, Davis Herring <address@hidden> wrote:
>> 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.

Yes, but I can't see that you cover the case that the id converted id
is already used. Or do you do that?

reply via email to

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