How to make the website show signs like "č" and "ć"?

22,296

Solution 1

http://webdesign.maratz.com/lab/utf_table/

Use HTML entities, for example

  • č : č
  • ž : ž

Solution 2

This sounds more like a font issue than a character encoding issue. If it were a character encoding issue, the characters would most likely be displayed as 2+ ASCII characters. The boxes, however, typically mean the character encoding is correct, but that specific character is not available in the font being used (which is especially common with lesser-used fonts). This would explain why it's behaving incorrectly in both the website and Notepad++.

To fix the issue, simply use a different font in your editor and website.

Note: I recommend a widely used font for the best chance of it working. Specifying a generic name in the website (e.g. serif or sans-serif) will probably have even better results, as the OS/browser would decide on the best font to use.

Solution 3

In short, be consistent about your character encoding throughout.

  1. Configure your editor to save in the encoding you want
  2. If you use any server side programming, make sure it isn't transcoding your data
  3. If you use a database, make sure it is configured to use the same encoding
  4. Configure your server to emit a Content-Type header that specifies that encoding
  5. Use the meta tag in your question

The W3C provides useful material on encodings that starts here.

Solution 4

A useful site for special characters and their ASCII-codes: CopyPaste Character

To 'type' them, use the alt codes.
However, to use them in your site, you'll better use the HTML codes like you can find on CPC

Solution 5

As a test, try this:

<span style="font-family:Arial Unicode MS">
    č ć ž đ š
</span>

You should be able to see your characters correctly.

Share:
22,296
corazza
Author by

corazza

flowing.systems

Updated on December 12, 2020

Comments

  • corazza
    corazza over 3 years

    I'm making a website that is in Croatian, and I need to use signs like: "č", "ć", "ž", "đ" and "š". They are currently displayed as little boxes.

    Info:

    • I use Notepad ++.
    • I set the encoding there to UTF-8.
    • I put the following line of HTML in: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

    However, it does not work. Even Notepad ++ can't display my characters using UTF-8, so that would suggest that I should probably use something else...