A Conversation for Website Developer's Forum
Putting unusual symbols into html
Frankie Roberto Started conversation Apr 30, 2003
Okay I need a crash course in getting certain symbols to display in html pages.
The particular ones I'm after are the symbol for 'For All' which looks like an upside down capital A and the existential quanitifier, which looks like a back-to-front E. Both are listed in the unicode set at http://www.unicode.org/charts/PDF/U2200.pdf but I have no idea if, and how, I can get them to display in an html page.
Putting unusual symbols into html
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Apr 30, 2003
Start by setting the charset for the document to utf-8 with a meta tag then use the entity to display the symbol. The entity would look like &#x____; where the underscores are replaced by the hexadecimal code for the symbol you want. There's also a little useful utility that works like the "insert symbol" command in Word but lists all the Unicode characters are present. I can't remember the name of the utility but I have it back at my office.
You have to be careful about fonts too. Not all fonts have all Unicode characters, so if you are specify the font on your page check it out first. http://www.alanwood.net/unicode/fonts.html is a good resource for fonts and all things Unicode in general.
Putting unusual symbols into html
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Apr 30, 2003
And invest in a good grammar checker, and never never get up to let the dog out when you are in the middle of typing a sentence.
Putting unusual symbols into html
Frankie Roberto Posted May 1, 2003
Hmm, all I'm getting is [] squares.
Putting unusual symbols into html
Frankie Roberto Posted May 1, 2003
Ah, got stuck with differences between hex and decimal...
Putting unusual symbols into html
Ion the Naysayer Posted May 1, 2003
As an added bonus, Unicode works this way in any SGML derived language which includes any form of XML as well. There are also named shortcuts for most of the symbols, such as © & and so forth. I think I remember seeing a table of common ones on the W3C website but I'm not quite sure.
Putting unusual symbols into html
Frankie Roberto Posted May 1, 2003
but you have to define entities for XML don't you? I seem to remember h2g2 having a problem with that, hence entities requiring an tag.
Putting unusual symbols into html
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted May 2, 2003
h2g2's character set is ISO-8859, not UTF-8, and that is what limits it. You actually do not have to use the entities at all. If you have an editor that supports Unicode and the proper keyboard layout or input method, you can type the character directly, and the character itself is entered (as opposed to the entitity which is a representation of the single unicode character using 8 ascii characters). If you don't use entities, you don't have to define them. Dreamweaver MX works with Unicode directly, as do all of the MS Office products (Office 2000 and up). Check out the alanwood.net for other software. I can recommend some Mac stuff if you are using a Mac.
Putting unusual symbols into html
Frankie Roberto Posted May 2, 2003
Ah yes, but if you want people to submit things in xml, and they don't have the ability to encode the character directly (no button on keyboard), it's impossible to let people type in entities like &foreach; without defining them.
Putting unusual symbols into html
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted May 2, 2003
That's where one of the utilities come in, many of them free:
http://www.alanwood.net/unicode/utilities_fonts.html
Character Agent was the one I was thinking of, some of the newer ones look like they may be better. Keyman has been around for a long time, but last time I looked they hadn't added Unicode support and their web site said something about Unicode being an untested and likely passing fad. I guess they changed their minds.
Rather than pasting in the entity, most of them paste in the character itself. Of course if it's easier to define the entities (which probably has been done already and just needs to be copied or referenced), then go for it.
Putting unusual symbols into html
Ion the Naysayer Posted May 5, 2003
I believe the definitive answer is here:
http://www.w3.org/TR/REC-xml#charsets
The way I'm reading that, you don't need to declare the hex values of the entities. I'm not sure if the text versions are part of the XML specification or if they only work in XHTML.
Key: Complain about this post
Putting unusual symbols into html
- 1: Frankie Roberto (Apr 30, 2003)
- 2: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Apr 30, 2003)
- 3: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Apr 30, 2003)
- 4: Frankie Roberto (May 1, 2003)
- 5: Frankie Roberto (May 1, 2003)
- 6: Ion the Naysayer (May 1, 2003)
- 7: Frankie Roberto (May 1, 2003)
- 8: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (May 2, 2003)
- 9: Frankie Roberto (May 2, 2003)
- 10: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (May 2, 2003)
- 11: Ion the Naysayer (May 5, 2003)
- 12: Frankie Roberto (May 5, 2003)
More Conversations for Website Developer's Forum
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."