document.referrer is providing accented letters
I'm using document.referrer for grabbing previous URL of current page and sending it to a curl file,that curl file again send this variable to a PHP file for saving it into data base. The problem is that on saving into database I'm getting URL value as accented letters like
†Ûiÿû®û(~×(›û®û(~×â•ïðŠwhÂÏڞئjî
I've used base64
coding scheme in my php file.The collation of MySQL column is latin1_swedish_ci
.
Thanks.
As the commenter suggests, I think this is simply a problem where the encoding of the URL isn't the same as the encoding of your database. Using utf-8
on your database tables would solve most (if not all) of your problems. Here is a two part article (part 1 and part 2) that discusses how to use utf-8
in PHP and MySQL.
上一篇: 检查焦点是否设置为excel单元格