Scodigo, Inc.

Log In | Register

Cart Items:
0

Different Results on Mac vs. PC

Hello all.

I have PHP Pill installed on both a Mac and PC versions of FileMaker 11. On the Mac, things behave as expected. On the PC, they do not. My code is below:

$old_string= 'Antique Houses™ Appointment Calendar';
$find = '/[^a-z0-9]/i';
$replace = '';
$new_string = preg_replace($find, $replace, $old_string);
$new_string = trim($new_string, "");
echo $new_string;

So on the Mac, the above returns:
AntiqueHousesAppointmentCalendar

vs. the PC returns:
AntiqueHousesTAppointmentCalendar

Is there any reason on the PC converts the TM to a T instead of removing as it should via regex?
Thanks.

Different Results on Mac vs. PC

Micah Woods's picture

Hello Rick,

Mac and Windows handle character sets in slightly different ways. If you try simply echoing out $old_string, you'll find that the (tm) isn't actually "getting through", meaning that on Windows, the plug-in isn't able to receive the (tm) symbol. When PHP 6 is released, we hope to fully support Unicode but currently the plug-in is limited to ISO-8859-1 (obviously with some inconsistencies per platform).

One solution is to look at the "_PHPExecuteUnicode" custom function in the Testbed.fp7 file that's included in the SmartPill download. I did a quick test and the results using this function are as expected.

Regards,
Micah