user1388352
user1388352

Reputation: 151

Issue with encoding

My html is in utf-8, as is my sql and my tables. But my variables are not saving latin characters. Is as if the post variables are changing the characters before sending it to my database.

Upvotes: 0

Views: 29

Answers (1)

user1388352
user1388352

Reputation: 151

The problem was that I was sending my information via ajax, and I didn´t defined UTF-8 on ajax. I solved the problem by adding xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8"); on my Ajax script

Upvotes: 1

Related Questions