C
Csaba2000
Most of the time when I think of escaping characters in HTML,
it's ensuring that I can print certain characters instead of havingt them
be interpreted by the HTML parser. (eg. I can have a less than sign
rendered by using "<" (without the quotes)).
But I want to go in the other direction. I want to be able to encode
arbitrary characters so that when they arrive at the browser they're
interpreted correctly at the appropriate time.
So, for example, I'd like to be able to do something like (note the
inner single quote):
<img src="Dinner.jpg" alt='"He's eating like a horse", she said'>
I'm after a generic solution, if possible, as the above example is
a fairly simplistic illustration. In addition, I may want to encode
other characters such as the alt itself or the symbols such as
the "less than" or "equal" sign (so this might actually be two
questions).
Thanks for any tips,
Csaba Gabor
it's ensuring that I can print certain characters instead of havingt them
be interpreted by the HTML parser. (eg. I can have a less than sign
rendered by using "<" (without the quotes)).
But I want to go in the other direction. I want to be able to encode
arbitrary characters so that when they arrive at the browser they're
interpreted correctly at the appropriate time.
So, for example, I'd like to be able to do something like (note the
inner single quote):
<img src="Dinner.jpg" alt='"He's eating like a horse", she said'>
I'm after a generic solution, if possible, as the above example is
a fairly simplistic illustration. In addition, I may want to encode
other characters such as the alt itself or the symbols such as
the "less than" or "equal" sign (so this might actually be two
questions).
Thanks for any tips,
Csaba Gabor