Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamshark70 opened this issue Dec 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jamshark70
Copy link

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!)

@scztt
Copy link
Owner

scztt commented Apr 17, 2024

I think we just need to re-encode the url %00 forms back to unicode characters. I can look into this - James, let me know if you have any clues. I can see that I've already added a note for myself in extString.sc in LanguageServer.quark:

        // @TODO More url encode replacements...
        var replacements = (
            "%20": " "
        );

@scztt scztt added the bug Something isn't working label Apr 17, 2024
@scztt
Copy link
Owner

scztt commented Apr 18, 2024

This should fix, but I'd be happy if you could give it some more rigorous testing in your environment!
scztt/LanguageServer.quark@6024ae7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants