I am stuck in comparing two unicode strings in PHP which both contain the special char \'ö\'. One string comes from $_GET
, the other one is a filesystem\'s fold
Can you try parsing them through utf8_encode() and checking them there? PHP doesn't support unicode and therefore advises to use utf8_encode/decode for some basic Unicode features.
http://php.net/manual/en/language.types.string.php
See here: http://en.wikipedia.org/wiki/Unicode_equivalence and use this: http://www.php.net/manual/en/class.normalizer.php
You probably have a decomposed character in the longer string, meaning an o and then a umlaut combining character which overlays the previous character.
The normalizer function will fix things like that.
As a side note you should always normalize your input if you are using it for equivalence (for example a username - you want to make sure two people don't choose the same username, even if the binary representation of the string happens to be different).