M
M
Maxim Tkachuk2012-04-19 14:56:40
PHP
Maxim Tkachuk, 2012-04-19 14:56:40

Encoding issue (SOLVED)

I am writing a small project in PHP.
Set html encoding to UTF-8

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

The database has the same encoding. Everything seems to be working great.
But when I use the htmlspecialchars function, the whole page breaks.
static function e($str){
    return htmlspecialchars($str, ENT_QUOTES, "UTF-8");
}

and this is what happens:

And the whole text becomes like this, and not just the one that was run through the function.

Tell me how to fix?

PS: if anything, then I write on the Fat-Free Framework. And by the way, UTF-8 encoding is also set there

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Shabanov, 2012-04-19
@makzimko

check the encoding of the file itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question