php - Safely Store HTML in DB without affecting Character encoding -


I want to move a string and store it in an MYSQL db. This string will be an HTML string and can be any encoding or written in any language.

How can I save it safely in my SEO SEL so that I can recover it as it is?

In addition, in the field, that data type is of text and there is a combination of latin1_swedish_ci , anyway what will happen?

I am currently doing this:

  hobbies ($ html, ENT_QUOTES, 'UTF-8')   

but I do not think all of the above characters will work for sets. I mean how the German or Japanese characters will be affected?

Thanks for any help.

Why not base 64 to encode it for storage, and then decode it?

Comments