Problem with PHP charset accents

I have a form on my page so that users leave comments.

I am currently using this encoding:

meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" 

but getting the comment from the bytecode does not display correctly ( Example. → ).

What parameters should I care about the proper handling of accents?

solvable

  • meta tag changed to charset = 'utf-8'

  • modified Mysql character set (ALTER TABLE comments CONVERT TO CHARACTER SET utf-8)

  • changed the character set of the connection when inserting records and extracting ($ conn-> query ('SET NAMES utf8'))

Accents are now displayed correctly

thank

Luke

+5
source share
2

ISO-8859-1 . UTF-8 , , , UTF-8.

+1

, - LAMP. , , .

, :  - - ( )  - PHP MySQL

, , , ISO-8859-1.

:

  • , - , , , , . , / , , . "" (, "" ), . , ISO-8859-1 ().
  • MySQL , , , . , MySQL , . , , .

, - - . - -charset ( , , ), , .

, , , , , , , .

, :

, - ( - MySQL):

SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';

MySQL:

SHOW CREATE TABLE myTable;

( myTable - , / /)

+2

All Articles