Problem with accentuation HTML and MYSQL

1

I'm having a lot of problems with accentuation, first of all, I'm using WAMP Server. The charset of my site is UTF-8, that's why ISO-xxx ... it simply unconfigures all the accentuation of the HTML page, in other words, I have two fields in MySQL with emphasis that were inserted from a form on my site and this was the result: link

On my site to "echo" these fields in an edit form this is the result: link As you can see the accent errors are gone.

These are the collations of these fields: link

Any ideas how to kill this bug?

    
asked by anonymous 26.01.2015 / 18:04

1 answer

2

Before importing the data into your MySQL database, define a default collation. In Brazil, Latin1 is the most used, so the standard CHARSET (character encoding) is Latin1 and the default COLLATE (collation) is latin1_general_ci . External scripts can use UTF8 and it is usually because of the difference of encoding between Latin1 and UTF8 that accent errors occur.

ALTER DATABASE 'sua_base' CHARSET = Latin1 COLLATE = latin1_swedish_ci;

OU

ALTER DATABASE 'sua_base' CHARSET = UTF8 COLLATE = utf8_general_ci;
    
28.01.2015 / 01:03