PHP basename() and pathinfo() with Multibytes UTF-8 file names
问题 I've found that PHP function basename(), as well as pathinfo() have a strange behaviour with multibyte utf-8 names. They remove all non-Latin characters until the first Latin character or punctuation sign. However, after that, subsequent non-Latin characters are preserved. basename("àxà"); // returns "xà", I would expect "àxà" or just "x" instead pathinfo("àyà/àxà", PATHINFO_BASENAME); // returns "xà", same as above but curiously the dirname part of pathinfo() works fine: pathinfo("àyà/àxà",