Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

showing umlauts in html with utf8 charset

Tags:

html

utf-8

This question is most likely answered many times before, but I have searched some hours now and I still don't understand one basic thing (most probably the utf8-charset itself...).

I have a html with german umlauts "ä" and "ö" (ä and ö):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
hällö
</body>
</html>

which results into the output of "h�ll�".

When I leave out <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> the result becomes "hällö" in my browser (probably with some german charset settings??) - as it should be.

Why don't umlauts work like "normal" (ASCII) characters in utf8-charset and what can I do to make them so (beside of encoding, decoding and masking)?

like image 351
Wooz Avatar asked Nov 28 '25 01:11

Wooz


1 Answers

If you specified "charset=utf-8", you have to upload/use a "File" that is encoded with UTF-8.

To do this on Windows:

  1. Open your html/php.. file in Notepad.
  2. go to "File" and choose "Save As"
  3. Set the "Encoding" field to "UTF-8"

-> Profit

like image 142
Lucky's Avatar answered Nov 29 '25 16:11

Lucky's



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!