0

I was wondering why we should use $quot or &ldquot over regular string representations of those characters? What are these characters called and why would we use them anything else in an html file?

I would google this myself but I don't even know what these characters are? Is it Unicode? ASCII?

Is it faster to represent quotes and ellipsis this way?

Jwan622
  • 11,015
  • 21
  • 88
  • 181

2 Answers2

1

It may have to do with encoding. If you use " etc, you leave it up to the browser and/or the operating system on how to display it. It should work with all encodings.

If you use an actual character, you need to specify the encoding (e.g., utf-8), in the document's meta tag. I prefer to do everything in utf-8 and use real characters as opposed to the html entity equivalents, and I believe that is the W3C recommendation these days (though don't quote me on it).

theglossy1
  • 543
  • 3
  • 13
0

why we should use $quot or &ldquot over regular string representations

It's " and you would use it only in attribute values delimited by " characters because a literal " would end the attribute value.

why we should use &ldquot over regular string representations

It is &ldquot; and you would use it either because:

  • You had no convenient way to type the literal character
  • You were using a character encoding which didn't include the character

The latter shouldn't be a problem this century because we have had good support for UTF-8 for ages.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335