Re: Encoding / Entity in input element
- From: "Alan J. Flavell" <flavell@xxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Apr 2006 13:00:26 +0100
On Tue, 18 Apr 2006, Gazza wrote:
<http://garyjones.co.uk/development/input.html>
I'm trying to get a Rupee Sign (₨) displayed in an input field,
Your posting is inconsistent with your test page - your "input field"
does not contain the value ₨
and from the demo page it's clearly not working.
If you're having problems with HTML, wouldn't it be nicer to get the
javascript stuff out of the way, in case it's causing unnecessary
complications?
The HTML DTD says that input values
are #CDATA, whereas most other attributes are #PCDATA,
This is confusing stuff. CDATA in an attribute value doesn't have the
same implications as CDATA as element content model. Certainly you
can expect value="₨" to be parsed and interpreted as the
character which it represents, just as your title="₨" is already
being so interpreted (I'm seeing a pop-up that says "Rp" when I hover
over your empty text field).
That would not be the case in CDATA element content (script or style
elements, in HTML).
Your *Javascript* element content is CDATA, and you've no business
trying to use HTML notation in there (except when the results of the
JS are going to be interpreted as HTML, of course, such as modifying
the DOM, or document.write...).
and the lack of parsing
is why I'm getting a literal "₨" as the value.
No. If you're seeing that (but *where* exactly are you seeing it?
You've introduced too much complexity, your posting seems to me to be
incompatible with your test case, and you aren't making it clear what
you tried), my hunch is that it's for a very different reason.
Your served-out page is encoded in iso-8859-1, so it cannot submit a
rupee character as such. Recent browsers have, lemming-like, all
leaped on the MS bandwagon of applying a completely illogical
HTML-ification of submitted characters if they can't be coded in the
page's own character encoding.
http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html might help
with some background (but no javascript, though).
As a side note, I'm assuming that the reason that the sign appears
as "Rs" in a paragraph and as "Rp" in an option element are due to
the different fonts being used?
I'm not yet sure. The unicode database shows ₨ (U+20A8) as a
compatibility character, decomposing to 0052 0073, which is "Rs"; a
browser would be in its right to display that if it felt so inclined,
e.g if it couldn't find a suitable font.
best I can do at the mo, E&OE
.
- Follow-Ups:
- Re: Encoding / Entity in input element
- From: Gazza
- Re: Encoding / Entity in input element
- References:
- Encoding / Entity in input element
- From: Gazza
- Encoding / Entity in input element
- Prev by Date: Encoding / Entity in input element
- Next by Date: Re: IE v7 .... a big thumbs up
- Previous by thread: Encoding / Entity in input element
- Next by thread: Re: Encoding / Entity in input element
- Index(es):
Relevant Pages
|