path: fix unicode path problems in path.relative
This commit changes the way two paths are compared in path.relative: Instead of comparing each char code in path strings one by one, which causes problems when the number of char codes in lowercased path string does not match the original one (e.g. path contains certain Unicode characters like 'İ'), it now splits the path string by backslash and compares the parts instead.
Fixes: https://github.com/nodejs/node/issues/27534
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines