Autoreload doesn’t work with unicode paths
If the elixir-koans folder is located in a path with non-ASCII characters, the autoreloading doesn’t work. An error like this is raised every time a change is detected:
** (Code.LoadError) could not load /Users/stomsa/_dev/Å/elixir-koans/lib/koans/02_strings.ex
(elixir) lib/code.ex:1147: Code.find_file/2
(elixir) lib/code.ex:713: Code.load_file/2
The path should be ~/_dev/ň/ and not ~/_dev/Å/.
Happens on macOS Mojave 10.14 (18A391) with zsh.
I dug in a little bit on this. The error originates here. It ultimately seems that :elixir_utils.read_file_type doesn't handle these characters well. I don't have time to dig in any further right now, but overall it feels like an Elixir/Erlang issue more than this specific project. That is unless there is some escaping or something special that needs to happen in order to support paths like this.
I did, however, notice a deprecated call which is fixed in #229.
Thanks for taking a look at this, @iamvery! I examined a bit too and I at least found out that the Watcher’s handle_info method already receive an already invalid path. Printing it out, the Unicode characters are already botched.
I wanted to dig deeper and see the actual result of file_system’s parse_line method for a Mac worker, but I wasn’t able to get my changes actually executed.
My impression is that the culprit lies somewhere there, not translating the platform-specific watcher result correctly. But maybe it’s even deeper.
Fun times 😅