Forum Moderators: open

Message Too Old, No Replies

The future of entities

Will ϑ always be the longest?

         

Wassercrats

1:18 pm on Feb 27, 2003 (gmt 0)

10+ Year Member



I'm developing a script that converts literal characters into HTML character entities under certain conditions. One condition is that an ampersand doesn't get converted to an entity if it is part of one. I don't check for valid entity names, but I use a "smart" and less accurate approach which includes checking for the length between the ampersand and semicolon. If the length is over eight characters, then I convert the ampersand to an entity.

Should the number of characters between the ampersand and the semicolon be a factor in my script? What maximum length would you choose?

BlobFisk

2:19 pm on Feb 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Wassercrats! Check out Marcia's excellent WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com].

Off the top of my head, I believe that the maximum number of characters between the ampersand and the semi-colon in HTML Unicode is 8.

<edit>Typo fix</edit>