这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@AlifianK
Copy link
Contributor

@AlifianK AlifianK commented Oct 11, 2024

Description

Attach manifest to enable reading files with Unicode characters name (eg. Japanese, Russian, etc). Note that this only works for Windows 10 version 1903 and later. See this link for more information. This is taken from @scurest and @kmilos contribution, and uses libavif for its inspiration. Tested on MSVC with cl, clang-cl, clang-gnu frontend, and MSYS2 with ucrt64 (GCC toolchain) and clang64 (LLVM toolchain).
Fixes #683.

Pull Request Checklist

  • CLA Signed: Have you signed the Contributor License Agreement (individual or corporate, as appropriate)? Only contributions from signed contributors can be accepted.
  • Authors: Have you considered adding your name to the AUTHORS file?
  • Code Style: Have you ensured your code adheres to the project's coding style guidelines? You can use ./ci.sh lint for automatic code formatting.

Copy link
Member

@mo271 mo271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mo271 mo271 requested a review from sboukortt October 17, 2024 07:43
@mo271 mo271 added this pull request to the merge queue Oct 17, 2024
Merged via the queue into libjxl:main with commit 7b70ef1 Oct 17, 2024
100 of 102 checks passed
@Theo1996
Copy link

Would be nice ig it didnt drop support for anything before Malware 10 version 1903

@sboukortt
Copy link
Member

Would be nice ig it didnt drop support for anything before Malware 10 version 1903

  1. No need for the inflammatory language.

  2. It shouldn’t: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activeCodePage

    This element was first added in Windows 10 version 1903 (May 2019 Update). You can declare this property and target/run on earlier Windows builds

@kmilos
Copy link

kmilos commented Oct 18, 2024

it didnt drop support

It doesn't drop anything, as there was no support for Unicode (i.e. legacy -W API conversion) for Windows in libjxl tools to begin with. This at least adds UTF-8 for Windows 10 1903 and later. On earlier Windows versions it continues working just the same as today, i.e. ASCII only.

@Theo1996
Copy link

Let me rephrase, maybe add something that works before 1903?
Because I run it and still cant read image data , in my case it has some chinese and Tiếng Việt chars)

@AlifianK
Copy link
Contributor Author

AlifianK commented Oct 18, 2024

Let me rephrase, maybe add something that works before 1903? Because I run it and still cant read image data , in my case it has some chinese and Tiếng Việt chars)

There's no 'something' if you use Windows that is older than Windows 10 version 1903, other than patching the code to use -W API, but that would mean a complete overhaul of the entire codebase.
You can, however, use a PowerShell script to temporarily rename the name of the files.

Get-ChildItem *.png,*.jpg | ForEach-Object {$name = $_.BaseName;Rename-Item -Path $_ -NewName ($_ -replace $_.BaseName,'a');cjxl -e 9 -d 1 "a$($_.Extension)" "a.jxl";Rename-Item -Path "a$($_.Extension)" -NewName "$name$($_.Extension)";Rename-Item -Path 'a.jxl' -NewName "$name.jxl"}

@kmilos
Copy link

kmilos commented Oct 21, 2024

maybe add something that works before 1903?

To put things into perspective: this addition was almost trivial, around 20 lines (of configuration, not even code), and covers >96% of Windows users.

To cover the remaining <4% (and declining; also no longer supported by the OS vendor), the code changes required are non-trivial, need a more substantial developer effort and time, and can introduce new bugs that would need to be tested and addressed...

mo271 pushed a commit to mo271/libjxl that referenced this pull request Nov 26, 2024
mo271 pushed a commit that referenced this pull request Nov 26, 2024
@the-r3dacted
Copy link

the-r3dacted commented Apr 7, 2025

it didnt drop support

It doesn't drop anything, as there was no support for Unicode (i.e. legacy -W API conversion) for Windows in libjxl tools to begin with. This at least adds UTF-8 for Windows 10 1903 and later. On earlier Windows versions it continues working just the same as today, i.e. ASCII only.

He's not completely wrong, but like it's only an issue once you get to XP. The official release doesn't work on pre-7, but a build with clang can run just fine on XP, but it requires a change to the manifest.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <windowsSettings>
        <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
      </windowsSettings>
    </application>
  </compatibility>
</assembly>

@the-r3dacted
Copy link

Nevermind, apparently this breaks UTF-8 support on 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows cjxl.exe cannot handle Japenes/Chinese/Russian unicode filenames

7 participants