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.