I'm trying to find more information to explain a problem I'm currently having - perhaps someone here has already encountered this?
I have a form that accepts user input into text fields and inserts it into a table. To ensure the data goes into the DB I'm using addslashes() on the insert and stripslashes() when retrieving it.
However, this doesn't appear to work correctly with Chinese (Big5) character sets as stripslashes() doesn't seem to remove all the slashes that were added by addslashes(). Why is this?
All other (hardcoded) Chinese characters on the page appear correctly so I know the page encoding is correct - is it a MySQL configuration issue? Possibly a PHP or web server configuration error? More likely just user error on my part 😃
I know I could (and probably should) use htmlentities() but I think I've read somewhere that it is no good for PHP v4.1.0 or earlier - or have I got that wrong?