vscode-supercollider icon indicating copy to clipboard operation
vscode-supercollider copied to clipboard

"nowExecutingPath" with extended Unicode characters is not correct in vscode

Open jamshark70 opened this issue 1 year ago • 2 comments

I have an scd file at "/media/dlm/T7/23-24-fall/大课-exam-works". Also in that directory, there's a text file "zipdir.txt".

In SC-IDE:

p = thisProcess.nowExecutingPath.dirname +/+ "zipdir.txt";
-> /media/dlm/T7/23-24-fall/大课-exam-works/zipdir.txt

f = File(p, "r");
f.isOpen;
-> true

f.close;

In VSCode:

p = thisProcess.nowExecutingPath.dirname +/+ "zipdir.txt";
> /media/dlm/T7/23-24-fall/%E5%A4%A7%E8%AF%BE-exam-works/zipdir.txt -- nope

f = File(p, "r");
f.isOpen;
> false  -- nope

f = File("/media/dlm/T7/23-24-fall/大课-exam-works/zipdir.txt", "r");
f.isOpen;
> true  -- yep

f.close;

So the vscode-sc plug-in is handling Unicode characters in user code correctly, but it isn't sending a correctly encoded "current document" path to sclang.

(I remember how much work Moss had to do on Unicode in sclang and scsynth... a very annoying class of issue!)

jamshark70 avatar Dec 29 '23 02:12 jamshark70