By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

html symbols and unicode

P: n/a
My question is presented more clearly in following web page:

http://www.pinyinology.com/signs2.html

<html>
HTML entities display outside script tags:
a&sup1;, a&sup2;, a&sup3;, a⁴

But unicode doesn't display outside script tags:
a\xb2, a\xb3, a\u2074

<script type='text/javascript'>

//Both HTML symbols and unicode display within script tags:

document.write ('a&sup1;, a&sup2;, a&sup3;, a⁴');

//and

document.write ('a\xb2, a\xb3, a\u2074');
</script>

Question: lucida sans unicode is declared within the style tags, why
unicode doesn't work outside script tags?
</html>

Aug 25 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

dalei wrote:
My question is presented more clearly in following web page:

http://www.pinyinology.com/signs2.html

<html>
HTML entities display outside script tags:
a&sup1;, a&sup2;, a&sup3;, a4

But unicode doesn't display outside script tags:
a\xb2, a\xb3, a\u2074
Of course not. \xXX and \uXXXX is an escape sequence in javascript.
<script type='text/javascript'>

//Both HTML symbols and unicode display within script tags:

document.write ('a&sup1;, a&sup2;, a&sup3;, a4');

//and

document.write ('a\xb2, a\xb3, a\u2074');
</script>

Question: lucida sans unicode is declared within the style tags, why
unicode doesn't work outside script tags?
</html>


To use unicode most effectively in your html, use numeric ampersand
entities. For example: ² is equivalent to &sup2; and ³ is
equivalent to &sup3.

Hope this helps. :)

Aug 25 '05 #2

P: n/a
dalei wrote:
My question is presented more clearly in following web page:

http://www.pinyinology.com/signs2.html

<html>
HTML entities display outside script tags:
a&sup1;, a&sup2;, a&sup3;, a⁴

But unicode doesn't display outside script tags:
a\xb2, a\xb3, a\u2074

<script type='text/javascript'>

//Both HTML symbols and unicode display within script tags:

document.write ('a&sup1;, a&sup2;, a&sup3;, a⁴');

//and

document.write ('a\xb2, a\xb3, a\u2074');
</script>

Question: lucida sans unicode is declared within the style tags, why
unicode doesn't work outside script tags?
</html>


This question would be much better answered in an HTML forum, try:

comp.infosystems.www.authoring.html

My attempt is that when a character sequence &...; is parsed by the
browser's HTML parser an attempt is made to map it a character. If it
can't be mapped, then the literal characters are displayed.

e.g. &gt; becomes a 'greater than' symbol, but &tg; displays as
written because it can't be resolved into some special character.

The character sequence \x... is not understood by the browser's parser
(though I guess somewhere someone may have a browser that does) so it is
printed as is.

document.write attempts to resolve sequences like \x... and if possible
substitutes the appropriate character. I guess it uses the character
encoding for the page to work out which character to display for a
particular value.

You may find the following very useful for understanding character
encodings and repertoires:

<URL:http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist>
As for UNICODE, it specifies a certain mapping between numbers and
characters. You may find this useful:

<URL:http://www.unicode.org/unicode/standard/principles.html>
--
Rob
Aug 25 '05 #3

P: n/a
ASM
RobG wrote:
You may find the following very useful for understanding character
encodings and repertoires:

<URL:http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist>
or (in french) :
http://www.miakinen.net/vrac/charsets
As for UNICODE, it specifies a certain mapping between numbers and
characters. You may find this useful:

<URL:http://www.unicode.org/unicode/standard/principles.html>


see thread:
<43**********************@news.wanadoo.fr>

--
Stephane Moriaux et son [moins] vieux Mac
Aug 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.