13

I need to put the name of some universities on my web page. I have typed them as they were but in some browser or maybe some computers they appear differently. For example, "Universite de Moncton" should have the 2nd "e" in Universite with an accent acute over it. Could you please help about it.

Borre Mosch
  • 4,404
  • 2
  • 19
  • 28
Pouya BCD
  • 991
  • 4
  • 11
  • 23

7 Answers7

26

If you’re using a character set that contains that character, you can use an appropriate character encoding and use it literally:

Universit‌é de Moncton

Don’t forget to specify the character set/encoding properly.

If not, you can use an HTML character reference, either a numeric character reference that denotes the code point of the character in the Universal Character Set (UCS):

Universit‌é de Moncton
Universit‌é de Moncton

Or using an entity reference:

Universit‌é de Moncton

But this entity is just a named representation of the numeric character reference (see the list of entity references that are defined in HTML 4):

<!ENTITY eacute CDATA "&#233;" -- latin small letter e with acute,
                                  U+00E9 ISOlat1 -->
Gumbo
  • 643,351
  • 109
  • 780
  • 844
  • 1
    Of course you can do what I did ... and select that é in Gumbo's answer and cut and paste it where you need it .... :) – Mat Kay Jul 24 '13 at 23:45
5

You can use UTF-8 HTML Entities:

&#232;    è
&#233;    é
&#234;    ê
&#235;    ë

Here's a handy search page for the UTF-8 Character Map

scunliffe
  • 62,582
  • 25
  • 126
  • 161
3

There are two methods. One is by using "HTML entities." You need to enter them as, for example, &eacute;. Here is a comprehensive reference of named entities; you can also reference the Unicode code point of a given character, using its decimal form as &#1234; or its hex form as &#x4D2;.

Perhaps more common now (ten years after this answer was originally entered) is simply using Unicode characters directly. Rất dễ dàng, phải không? This is more acceptable and universal because most pages now use UTF-8 as their character encoding.

运气!

asthasr
  • 9,125
  • 1
  • 29
  • 43
3

I think from the mention that 'in some computers or browsers they appear differently' that the problem you have is with the page or server encoding. You must

  • encode the file correctly (how to do this depends on your text editor)
  • assign the correct encoding in your webpage, done with a meta tag

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

  • force the server encoding with, for example, PHP's header() function:

    header('Content-Type: text/plain; charset=ISO-8859-1');

Or, yes, as everyone has pointed out, use the html entities for those characters, which is always safe, but might make a mess when you try to find-replace in code.

Adriano Varoli Piazza
  • 7,297
  • 5
  • 39
  • 50
  • When you don't have control over what is posted to the page where you will be displaying the text (ie. dynamic) this option works. Or if you're pasting text to display on the page (and you can't replace each accented/diacritic character) - this is a great option. Thank you @Adriano (PS: The one that worked for me in a Classic Asp page was to add the meta tag) – Jonno Apr 20 '22 at 14:14
2

By typing it in to your HTML code. é <--You can copy and paste this one if you want. Microsoft windows has a character map for accessing characters not on your keyboard, it's called Character map.

Randy the Dev
  • 25,810
  • 6
  • 43
  • 54
  • 2
    +1 Although you have to be sure that the document's Content-Type describes the correct character encoding for that to work – Gareth Sep 28 '10 at 13:08
0

http://www.starr.net/is/type/htmlcodes.html

This site shows you the HTML markup for all of those characters that you will need :)

Scott
  • 2,143
  • 2
  • 19
  • 25
0

From here, we have to omit the first 0, like so:

div:after {
  content: "\00E9";
}
<div></div>
iorgv
  • 787
  • 2
  • 11
  • 26