Link to home
Start Free TrialLog in
Avatar of HATCHET
HATCHET

asked on

(75 pts) Which to use in HTML: ©, ©, or ©?

Which is the most correct to use while putting together an HTML document?

1) Put the character right into the HTML:  ©

2) Use the HTML shortcut for it:  ©

3) User the HTML character number:  ©

I've always thought that it's best to use the "HTML shortcut"... because using the character can cause problems with uploading to servers sometimes (the server's detect a non-standard character and flag the file as BINARY instead of ASCII), and using the character number would assume you're using a specific character set to render the page (when in fact your page may not be).

What is your opinion on this based on experience?  Which should be used?  WHY?

Is there a standard out there (W3C or Microsoft or something) that states you should use one or the other?

Thanks for your input on this!

ASKER CERTIFIED SOLUTION
Avatar of pinaldave
pinaldave
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marger50
marger50

HTML is basically plain text. You can create it with a text editor like Notepad. This eliminates the first option, because you can't create a copyright character in plain text.

The second two options both work. There are character entities (option #2) and numeric entities (option #3). There are numeric entities for pretty much everything. And there are character entities for the most commonly used special characters. If there is a character entity, there is no reason not to use it. If there isn't one, then you have no other option than to use the numeric entity.

In this case, I would use the &copy. But the &#169 works just as well.

Marge
Hi,

  I would personally use &#169 (the HTML character number), merely because it's the most formalized of the three.  As such, browsers that are a little more rigorous than IE about properly parsing HTML are more likely to work with your code.  Just my two cents, though.
Avatar of HATCHET

ASKER

pinaldave: Thanks for your input on this.   =)


marger50:
Actually, you can enter any ASCII character into a text editor like NOTEPAD by doing the following:

1) Turn on NUM LOCK
2) Hold the ALT key on your keyboard
3) Type the following on your keyboard KEYPAD (numbers on the top of the keyboard won't work): 0169
4) Release the ALT key on your keyboard

At this point, you'll get a © character inserted.  This works in any text field in any application (at least in Windows).

You were right about having a "numeric entity" for almost every character and symbol.  Here's the list from W3C:
http://www.w3.org/TR/REC-html40/sgml/entities.html

I knew you could use both, but I'm just wondering if one is "more correct" than the other.  The second option (©) seems to make more sense to me because it's more readable... you don't have to look at an ASCII table to find out which character it's referring to.  I was also curious if anyone's run into any problems when specifying a character set other than the default one.  Character #169 is © in the standard ASCII character set... but what if you're using a Japanese character set, or some other non-standard set?  I would assume that 169 would not always map to ©.
I think it would be safer to do the © since some browser/server will mess it up if you do direct © character.
HATCHET,
               I used HTML for a long tenure and I noticed that using the code  © in HTML is the best way to design.
                        YOu can also use other codes or characters but using shortcut © is the best as long as I faced these problems.
          Hoping you will get this info
you will find a complete list of Special Characters with their codes / names by following this link

http://resources.bravenet.com/quickref/special_chars/

i would go with ©..

Cheers,

SC

------------------------------
Samer Chidiac
Microsoft MVP - ASP/ASP.net
Avatar of HATCHET

ASKER

Thank you all for your comments.  It looks like the common concensus is that either  ©  or  ©  will work and both are equally acceptable, but sticking the character © directly into the HTML is a bad idea.  I personally think (and looks like most agree) that © is a better choice because its easier to read and avoids character set issues.

Cheers!