PHP / Apache problem with pound signs (£)

I have some text stored in a MySQL database, like this "Tom gave Sarah 5 pounds per book." Until last Monday, this was clearly visible on the site when pulled from the site, showing that "Tom gave Sarah 5 pounds for his book."

Now, although I have not changed / installed / removed / updated / updated at all, it stops working.

Old values ​​in the database are displayed as "Tom gave Sarah £ 5 per book." In a form that stores this text in the database, where it was used to save it in the database, since “Tom gave Sarah £ 5 per book,” now it is saved because “Tom gave Sarah 5 for his book” and displayed on ("Tom gave Sarah 5 for his book.")

What can cause this? I pull my hair out to try and figure it out. I played with utf8_encode / utf8_decode and used the ISO-8859-1 and UTF-8 character set for pages, and although each method gives different results (for example, "5" / "5" / "5" / "5" / "☐ 5 "), none of them are correct.

The problem cannot be MySQL, because I can see the E signs in phpMyAdmin, and the E signs work on a different web server.

Help!

+3
source share
2 answers

Instead of repeating this over and over, I just leave you with a link:

UTF-8 all the way to ...


If you follow the steps mentioned in the chazomaticus answer, your problems will disappear.

//, , .

+3

​​ utf8, . , UTF8. : "SET NAMES utf8;"

+1

Source: https://habr.com/ru/post/1729419/


All Articles