0
I have a text editor in my application that records html formatting in a longtext field. It happens that when I use the like to return the data it cannot find because of the generated Unicode characters.
I have this value in the bank (Pasta)
<p>Macarrão</p>
Mysql
select * from oficio where integra like '%Macarrão%' LIMIT 1
and it does not return records. How do I make it to Decode this value?
The best thing would be to already save right in the database. Normally you would convert to HTML in the view only. Anything you do on top of this is suffered, you will have to keep converting in every operation (query, editing, etc). It’s not because your editor returns the data so you will write it so right. You can convert the HTML Entities to the desired encoding and save them to the database. When you display them on the screen, it generates the entities again, and the rest starts working. Just convert the entities to the same native encoding of your table.
– Bacco
thanks @Bacco, I searched my editor’s documentation and solved the problem
– Alessandro Barros