Greywacke Posted March 11, 2010 Report Share Posted March 11, 2010 (edited) a short little test actually revealed that the following javascript code is what actually created this issue. (%E2%80%9C%20and%20%E2%80%9D) was alerted by opening the following javascript protocol alert(encodeURIComponent("(“ and ”)")); as a url in firefox.which other functions can encode a string containing double quotes without replacing them with multiple weird chars?this issue was posted at first under the PHP forum (http://w3schools.invisionzone.com/index.php?showtopic=30419). Edited March 11, 2010 by Pierre 'Greywacke' du Toit Link to comment Share on other sites More sharing options...
Ingolme Posted March 11, 2010 Report Share Posted March 11, 2010 Those specific quotation marks are encoded in UTF-8 format. You can use the utf8_decode() function on the string when it's received on the server side. Link to comment Share on other sites More sharing options...
Greywacke Posted March 11, 2010 Author Report Share Posted March 11, 2010 (edited) i tried that, but it replaces them with ? *sighs*unless you meant the utf8_decode as a javascript function, and not in the php AJAX handler where i implemented it... Edited March 11, 2010 by Pierre 'Greywacke' du Toit Link to comment Share on other sites More sharing options...
Greywacke Posted March 11, 2010 Author Report Share Posted March 11, 2010 (edited) this issue has been resolved by adding a function in the form handler to convert the messed up characters to the originally input ones. function rep_lrdquotes($string) { return str_replace("â€","”",str_replace("“","“",$string));} thanks for all the attempted help! Edited March 11, 2010 by Pierre 'Greywacke' du Toit Link to comment Share on other sites More sharing options...
justsomeguy Posted March 12, 2010 Report Share Posted March 12, 2010 which other functions can encode a string containing double quotesThe problem is that those aren't actually double quotes, they're some high-value unicode characters. Unicode is a multi-byte character set, so those characters require 3 bytes each. Those are the multiple characters you see when the 3 bytes get displayed as ASCII. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now