I have a website in Portuguese, in which when I change the version of php
and something else, when I insert it in the database, it does it badly and when it is recovered it comes out in the following way:
O hotel dispõe de 150 quartos. Todos os quartos têm telefone de ligação directa, acesso
As you can see, these characters: çã
are not correct.
The fact is that if I apply to that text a utf8_encode()
is as follows:
O hotel dispõe de 150 quartos. Todos os quartos têm telefone de ligação directa, acesso
Keep going the same.
But if I apply a utf8_encode(utf8_decode())
it is correct:
O hotel dispõe de 150 quartos. Todos os quartos têm telefone de ligação directa, acesso
The problem is that there are some cases in which with utf8_encode()
goes well and others do not, and also without putting anything appears correct. How can I automatically detect when I should use one or the other?
Currently I have it manually with if - else
depending on the id
of the page, but every time there is more so I need to automate it