PHP include problem with characters

Asked

Viewed 672 times

2

I’m using include in two files.

One file usually includes, however, the other comes with problems in the characters appears in the accents the character "".

But opening the two files on notepad++, they’re normal, with the accents and everything.

Does anyone know how to solve?

  • 3

    Check the Match of the file you are opening wrong. Save as UTF-8 that should work.

2 answers

2


Place in the COLLATE of the utf8_unicode_ci database

In the database connection script you put this

header('Content-Type: text/html; charset=utf-8');
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');

And on the arrows page the CHARSET you are the user

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

If none of that works

echo utf8_encode(  );

1

Open the files in Notepad++ and go to the Format menu button and select the option: Encoding in UTF-8 (without BOM), see that during this process there may be a character change in the file. php (ex: changing the letter t for or other strange character) so you must change this strange character by the correct character.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.