On 3/8/2006, at 15:43, Neil Lee wrote:
[...] Is there any way to get the decimal equivalents? My understanding is they're the most widely supported.
I would be very surprised if a browser fails to do the hexadecimal version.
But change sprintf("&#x%02X;", ch.unpack("U")[0]) to sprintf("&#%d;", ch.unpack("U")[0]) and it should print decimal entities.