htmlspecialchar and Japanese I have a site where a user can enter data into a field, which is then stored into a database. I am using htmlspecialchar and addslashes to prevent XSS and SQL injection.
The problem is that if I enter Japanese characters, htmlspecialchar ends up doing something wrong to them. I think the chars are stored via Unicode, and it's taking the & and changing it into & which is then unrendering the Japanese when it is displayed on the webpage.
Any clues how I should go about this? |