Support for Chinese Characters#14934
Merged
mergify[bot] merged 35 commits intodevelopfrom Apr 16, 2026
Merged
Conversation
2afc141 to
b4efa72
Compare
| */ | ||
| @CFunction | ||
| static native int PathFileExistsA(CCharPointer pszPath); | ||
| static native int PathFileExistsW(CShortPointer pszPath); |
Member
There was a problem hiding this comment.
- replacing the API with
PathFileExistsWmight be the right direction - the fastest way to test these changes is
sbt os-environment/test- builds small native image
- runs tests in native image mode
- way faster than building
ensoexecutable
- there is a dedicated test
- can it be enhanced with a sample demonstrating paths with non-ASCII characters?
JaroslavTulach
approved these changes
Apr 8, 2026
Member
JaroslavTulach
left a comment
There was a problem hiding this comment.
- We should be using
CTypeConversions, probably. - Great to have a test!
| @Test | ||
| public void changeDirUnicode() throws IOException { | ||
| var tmpDir = TMP_DIR.newFolder().toPath(); | ||
| var subDir = tmpDir.resolve("使用者"); |
| return null; | ||
| } | ||
| return path.trim(); | ||
| return asCharBuffer(buffer, length).toString(); |
Member
There was a problem hiding this comment.
I believe we should be using CTypeConversion, if possible:
Suggested change
| return asCharBuffer(buffer, length).toString(); | |
| return CTypeConversion.toJavaString(buffer, length, StandardCharsets.UTF16_LE); |
if that works and the test passes.
4e6
reviewed
Apr 15, 2026
jdunkerley
approved these changes
Apr 15, 2026
ed1c920 to
d089b47
Compare
vitvakatu
approved these changes
Apr 15, 2026
JaroslavTulach
requested changes
Apr 15, 2026
Member
JaroslavTulach
left a comment
There was a problem hiding this comment.
- please refactor
WindowsArgumentsto the sealed API pattern - consider
malloc, but it is OK to keep theMAX_LENGTHif you want - otherwise I am glad we can handle Chines Characters now!
| function getWindowsDocumentsPath() { | ||
| const out = childProcess.spawnSync( | ||
| 'reg', | ||
| 'powershell', |
Member
There was a problem hiding this comment.
What if we run on Windows that don't have powershell?
Member
There was a problem hiding this comment.
It's been built into Windows since Windows 7 I think - so think ok to assume its there.
| var res = PathFileExistsA(cPath.get()); | ||
| try { | ||
| var buffer = stringAsWCharPtr(full); | ||
| var res = PathFileExistsW(buffer); |
Member
There was a problem hiding this comment.
Yes, let's use W version of the API methods.
Member
|
Also please provide some description for this PR. |
Custom function to split the arguments (to be replaced with Win32 call).
Java format.
9220718 to
5752cab
Compare
JaroslavTulach
approved these changes
Apr 16, 2026
Member
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Fixes an issue that if the project is in a folder path in Windows with a UTF-16 character, it fails to launch.
Wversion of the Win32 API for controlling the working folder.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.