I installed Julia, and am trying to execute it by typing julia in Windows PowerShell. Then, the terminal shows
PS C:\Users\김시현> julia
ERROR: could not load library "C:\Users\김?�현\.julia\juliaup\julia-1.10.3+0.x64.w64.mingw32\lib\julia\sys.dll"
The specified module could not be found.
I think the error results from
김?�현
I don’t understand where this weird character comes from. How should I fix this?
I think that indeed Julia will not work if you install it in a home folder with non-ascii letters or with spaces…
What you can do if you use bash:
export JULIA_DEPOT_PATH="/.julia"
if the folder /.julia exists and can be written as normal user…
You might need a different command for powershell…
The key message: Create and environment variable with the name JULIA_DEPOT_PATH and set it to a path that exists, is writable and contains only ASCII characters…
The issue was that Windows paths use invalid UTF-16 to encode Korean names. Libuv uses UTF-8. Until recently libuv insisted on strict UTF-8 which means that when Windows gives it invalid UTF-16 (unpaired surrogates), it simply cannot handle it. There is, however, a thing called WTF-8, which is just UTF-8 allowing surrogate code points (they’re fine from UTF-8’s perspective, just technically disallowed), which allows handling arbitrary invalid UTF-16. @jameson and I finally got libuv to use WTF-8, so this is expected to be fixed now.
Bad news: after more careful testing, this issue still exists on v1.11-beta1.
The problem in my last test: my main system language is set to Chinese and the code page is 936, in the sandbox the language is set to English and the code page is also 936.
cp936 seems to maintain compatibility with UTF8, so no invalid UTF16 is generated.
Set the global language of the sandbox to Korean.
The default code page changes to cp 949.
Create a new test folder “테스트” again
Both v1.10.3 and v1.11.0-beta1 cannot load sys.dll
When the path contains only ascii characters, everything works fine.
The problem seems to be in the call to MultiByteToWideChar, where it is assumed that the input string is encoded in UTF8, while the actual incoming encoding is affected by the system language and code page settings.
I tested this on Julia 1.11 and got the same error. I was able to fix the issue and run Julia on a test user after enabling “Beta: Use Unicode UTF-8 for worldwide language support” in Time & Language → Language → “Administrative Language Settings”, and rebooting.
That makes more sense to me, thanks. What’s failing is basically our implementation of dlopen, which explains the issues I linked above (they’re about loading libraries), and has nothing to do with libuv, which explains why the mentioned PR didn’t solve this specific issue (as I expected).
Are you able to open an issue describing this or make PR to address this? Would be great if this just worked now that libuv supports it. Of
Course, I also thin like that everyone should just use UTF-8 for stuff like this, so I don’t see the “workaround” as a workaround really—it’s the way things should be done.
I recommend just REINSTALL your pc and change your user to english name for anyone who has same problem, it would be fast that you search solution on the internet and figure out it yourself.
it’s not working well which has installed on the destination path that contains Korean characters (it has not encoded as utf-8 by the historical reasons) in windows system.
installing the other programming languages (like Python, R, Matlab) got the same problem.
I believe this is no longer an “upstream” issue (in libuv), but if anyone wants to fix this open issue in Julia, then make sure there’s no security issue, or well fix it also, see below.
That seems like overkill, but if you do then do choose a good or best code page (either UTF-8 or) GB_18030 for Chinese and Koren/Hangul, 2-bytes per letter, twice as efficient as UTF-8 or anything other, also supporting all languages. Just changing to English or well ASCII in the path should be enough (and all filenames used by Julia), without reinstall, should be enough to start Julia and get anything to work. I was assuming the Korean EUC-KR encoding used, and many encodings including e.g. cp936, have an ASCII subset (if using only that, I believe you’re safe). If you DO reinstall, and choose appropriate encoding, e.g. UTF-8, then you should get away with any path/filename, not just English/ASCII, though likely not spaces in many contexts… (good software should though also handle that).
You may want to avoid e.g. cp936, for security reasons, at least for PHP. I would like to know if the security issue applies to Julia too, for sure, or at least potentially, and if also for GB_18030 which is seemingly a superset encoding of it.
If you do not want to rename, e.g. your user folder to ASCII, then maybe keeping it and making an ASCII symlink to it for Julia would help:
There are only three Unicode encodings, thereof IMHO 1 or 2 are good, UTF-8, and well this (not UTF-16) is the other one:
So use UTF-8 (aka in Windows codepage 65001 or in source code CP_UTF8).
Or use GB_18030 which is also good for the web. UTF-16 is no good for the web since it’s not ASCII compatible. Other sort-of important encodings, none of Unicode UTFs, and UTF-8 always way more popular on the web, are Windows-1521 for Russian/Cyrillic, Unified Hangul Code/CP949/EUC-KR, EUC-JP and the even lesser used Shift_JIS that seems to be crashing in use (but it and UTF-8 are though supported by QR codes).
Note currently verified as exploitable on installation with the following locales:
Traditional Chinese (Code Page 950)
Simplified Chinese (Code Page 936)
Japanese (Code Page 932)
When “Best Fit” isn’t
“A nasty bug with a very simple exploit—perfect for a Friday afternoon,” researchers with security firm WatchTowr wrote.
CVE-2024-4577, as the vulnerability is tracked, stems from errors in the way PHP converts unicode characters into ASCII. A feature built into Windows known as Best Fit allows attackers to use a technique known as argument injection to pass user-supplied input into commands executed by an application, in this case, PHP. Exploits allow attackers to bypass CVE-2012-1823, a critical code execution vulnerability patched in PHP in 2012.
IMPACT:
This vulnerability affects the following PHP versions:
– 8.1 before 8.1.29
– 8.2 before 8.2.20
– 8.3 before 8.3.8
@essenciary does Genie.jl have anything like auto_prepend_file or auto_append_file? Do you think this is very PHP specific, not an issue for your package or any Julia-related or other languages?
I.e. converts (0x00 prepended to) soft-hyphen, aka syllable hyphenoptional hyphen (a usually invisible non-char), to (0x00 then) visible hyphen-minus (I can see it being insecure), as seen here:
It seems intentional, but maybe not always desired. Though I think it’s probably not a security issue. More like you can’t have different files with only this change in the filename or path. Just as Windows file system is case insensitive.