views:

217

answers:

2

What is the HTML entity code for ž?

I am looking for something similar to » instead of something like ž.

+6  A: 

There is no standard entity defined in HTML to represent the character ž (U+017E); you can only use a numeric character reference like ž (hexadecimal) or ž (decimal).

But you can define such an entity for your document like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd" [
    <!ENTITY Zcaron  CDATA "&#381;"  -- latin capital letter Z with caron,
                                        U+017D ISOlat2 -->
    <!ENTITY zcaron  CDATA "&#382;"  -- latin small letter z with caron,
                                        U+017E ISOlat2 -->  
]>

Now you can reference the entities Zcaron (representing &#381;) and zcaron (representing &#382;) with &Zcaron; and &zcaron; respectively.

Or if you’re using a character set that contains that character (like Unicode’s character set), you can use a suitable character encoding (like UTF-8 in case of Unicode) to encode that character directly instead of using a character reference.

Gumbo
For reference, here are the HTML 4 character entities: http://www.w3.org/TR/html4/sgml/entities.html
Adam Backstrom
there's your answer
Mawg
+2  A: 
&#382;

My favourite lookup tool is LeftLogic's HTML Entity Character Lookup which allows you to find an entity based on visual similarity. In this case I typed in z and got entity and numeric codes for all variations of Latin z and Greek zeta.

e100
I only got two characters, Latin z and Greek zeta. I don't see any variations.
Kinopiko
Very nice!.....
Rob
@Kinopiko, you must check the option labeled "Incl. extended".
dusan
Ah, thanks. That's rather a handy website.
Kinopiko