spacemonkey Posted December 5, 2008 Share Posted December 5, 2008 I am trying to pass the contents of a user completed text field in FileMaker Pro 9 (- the FileMaker database is being served from Macosx 10.5.5 as is the PHP server (- same machine)) the (using Open URL script step) to a variable in the receiving send_message.php file. The text is transmitted and received, however, the user generated text includes 'smart quotes' (“ and ”) and consequently appear as “ and †respectively (-note the hidden character after the †for the ”). I have tried using the following code to no avail: $oldmsgString = "“"; $newmsgString = "\""; $test_message = stripslashes($_GET['message']); $new_message = str_replace($oldmsgString, $newmsgString, $test_message); Interestingly when I pasted the code directly from the send_message.php file into this post it appeared as: $oldmsgString = "‚Äú"; $newmsgString = "\""; $test_message = stripslashes($_GET['message']); $new_message = str_replace($oldmsgString, $newmsgString, $test_message); n.B. the content of the $oldmsgString. It would appear to be an issue to do with the text encoding in FileMaker and PHP but I have no idea how to resolve this. Is there a way I can convert the text received from the FileMaker text encoding to that expected by PHP? Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/135629-php-filemaker-special-characters/ Share on other sites More sharing options...
JonnoTheDev Posted December 5, 2008 Share Posted December 5, 2008 This is a real pain in the arse. Usually get this when people copy and paste text directly from microsoft word into a html text editor that saves into a database table. Never really found a solution, tested changing character sets and all kinds but nothing works completely. The problem using str_replace with a string like "“" is that php doesn't actually see the characters in that fashion. They only come out like that when printed to the screen. Hopefully somebody has the answer Quote Link to comment https://forums.phpfreaks.com/topic/135629-php-filemaker-special-characters/#findComment-706649 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.