Lumieducation/H5P-Nodejs-library

Local directory with certain unicode characters break system

sr258 opened this issue · 3 comments

sr258 commented

Due to the bug reported here, the library breaks when the library or content storage lies in a directory with these unicode characters.

sr258 commented

Problem seems to persist in html-exporter

sr258 commented

Example: LUMI-AEC

sr258 commented

I believe I've tracked down the origin of this: the postcss-url package also uses path.relative, which is broken in win32 for Turkish characters like (İ) that have different unicode length in uppercase and lowercase variants. None of the arguments of path.relative uses the problematic characters, but the current working directory of the users seems to include them. As path.relative and postcss-url convert relative paths to absolute paths using path.resolve, the working directory path is inserted into the string before the relative path is determined.

The solution should be to temporarily change the current working directory before calling postcss.