[rt-users] maintainably tagging custom fields for CSS

Nicholas Clark nick at ccl4.org
Tue Aug 14 07:22:13 EDT 2007

On Tue, Aug 14, 2007 at 10:01:08AM +0200, Espen Wiborg wrote:
> (Once more, to the list this time.)
> Jesse Vincent <jesse at bestpractical.com> writes:
> > On Mon, Aug 13, 2007 at 05:36:50PM +0100, Nicholas Clark wrote:
> >> Is there a good way to reliably map text outside the range of legal
> >> identifiers into that range, without having too many collisions?
> >> 
> >> (I realise that this might sound like "solve the halting problem" or "integer
> >> knapsack" but I think we need "good" rather than "perfect")
> > See if URL-encoding meets the spec?
> You'd have to strip out the percent signs; they're not allowed in XML
> IDs.  Other than that, URL-encoding sounds like the best bet.

Thanks. I had no idea about that subtlety of the the XML spec.
But I wonder, why do we need to URL encode them? If the RT admin is naming
custom fields with characters outside US-ASCII, then the HTML generated
will already contain Unicode characters, so why not keep (acceptable) Unicode
characters in the values given to the ID tags. If I understand it correctly,
the XML 1.1 spec allows most any alphanumeric character in names:


so I think it would be possible to produce valid identifiers simply by
stripping out all characters not valid in names. (whitespace, punctuation,
etc). Names will clash if someone configures two custom fields with names
that differ only in punctuation or whitespace, but in that case they pretty
much deserve what they are getting :-)

Nicholas Clark

More information about the rt-users mailing list