Use Windows wide APIs so Unicode paths work reliably#83
Closed
birenxiaofeigg-art wants to merge 7 commits into
Closed
Use Windows wide APIs so Unicode paths work reliably#83birenxiaofeigg-art wants to merge 7 commits into
birenxiaofeigg-art wants to merge 7 commits into
Conversation
johnnychen94
requested changes
Feb 27, 2026
johnnychen94
left a comment
Member
There was a problem hiding this comment.
- what is the minimal reproducible example of the bug? Test file, code snippet, output?
- make sure every bug fixes has associated test to avoid future regression
Comment on lines
+33
to
+36
| filename_utf16 = transcode(UInt16, filename) | ||
| push!(filename_utf16, 0) # add null terminator | ||
| mode_utf16 = transcode(UInt16, "rb") | ||
| push!(mode_utf16, 0) |
Member
There was a problem hiding this comment.
I believe this means "convert the filename using WChar type", and make sure the code is self-explanatory.
- It's not immediately clear what
transcode+push!(_, 0)means - You should use
Cwchar_tinstead ofUInt16
johnnychen94
requested changes
Mar 12, 2026
| @@ -0,0 +1,6 @@ | |||
| @testset "Images with wide char name" begin | |||
| img16 = PNGFiles.load("test_images/rgb测试16bit.png") | |||
Member
There was a problem hiding this comment.
If this is a random image, then we should probably just: randgen, write, rename to a Chinese filename, and then load back.
Keep tracking a 1.4M file in git history is too large for such a package.
|
|
||
| @test !isempty(img16) | ||
| @test eltype(img16) === ColorTypes.RGB{FixedPointNumbers.N0f16} | ||
| end No newline at end of file |
Member
There was a problem hiding this comment.
add missing new line endings
Member
|
Thank you for the PR. This was fixed in #84 |
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.
This submission aims to solve the problem that “load()" cannot correctly load the .png file path in GBK encoding format.