This function has a real challenge when it comes to Turkish. In Turkish the ASCII letter 'i' uppercases to a non-ASCII character. This means that PHP cannot upper case it.
i.e. for the Turkish locale, strtoupper('i')=='i'
This can mess with basic program logic.
There's no simple solution. The core problem is discussed more here:
http://www.i18nguy.com/unicode/turkish-i18n.html