A: 

Have you checked that both systems use the same locale?

What encoding is the PHP script using on both systems?

I would also try using strcmp instead of the equals operator. I'm not sure if the equals operator uses strcmp internally, but it's a simple thing to test out in your case.

Ben S
I use strpos in the actual implementation. I've also tried strcmp and mb_strpos. I think I might need to convert the strings to a common format before I compare them.
neu242
Also, I tried nfs mounting an ext3 file system on the Mac. The script returned "equal" when working on this file system, so I guess I can't blame the Mac locale.
neu242
+3  A: 

It seems that Mac OS X/HFS+ is using character combinations instead of single characters. So the ó (U+00F3) is instead encoded as o (U+006F) + ´ (U+CC81, COMBINING ACUTE ACCENT). See also Apple’s Unicode Decomposition Table.

Gumbo
Yes, it looks like MacOSX uses normalization form D (NFD) to encode UTF-8, while most other systems use NFC: http://www.j3e.de/linux/convmv/man/#hfs__on_os_x___darwin
neu242
+1  A: 

Solved: The Normalizer class can be used to detect NFD strings and convert them to NFC. It's available in PHP 5.3 or through the PECL Internationalization extension.

if (!normalizer_is_normalized($str)) {
   $str = normalizer_normalize($str);
}
neu242