Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad UTF-8 without BOM encoding

I converted all my files to UTF-8 without BOM encoding using Notepad++. I have no problem with BOMs anymore but the UTF without BOM encoding is simply not working, it's as if my site was encoded in ANSI. All special characters display either as: Â, Ú or á.

What can be the reason for this and how can I fix it?

http://chusmix.com/?ciudad=Pilar

Thanks

like image 202
lisovaccaro Avatar asked Aug 18 '11 05:08

lisovaccaro


People also ask

Does UTF-8 need BOM?

Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature.

What is UTF-8 without BOM?

The UTF-8 encoding without a BOM has the property that a document which contains only characters from the US-ASCII range is encoded byte-for-byte the same way as the same document encoded using the US-ASCII encoding. Such a document can be processed and understood when encoded either as UTF-8 or as US-ASCII.

Does UTF 16 require BOM?

In particular, if a text data stream is marked as UTF-16BE, UTF-16LE, UTF-32BE or UTF-32LE, a BOM is neither necessary nor permitted. Any U+FEFF would be interpreted as a ZWNBSP.


1 Answers

You have to tell the browser to accept it as UTF-8 so it will properly parse multibyte characters. Add this meta tag in your <head> tag with the rest of your metas:

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

Update

For HTML5, use this tag instead:

<meta charset="utf-8">

like image 116
SamT Avatar answered Sep 29 '22 07:09

SamT