-
Notifications
You must be signed in to change notification settings - Fork 84
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
[latexindent.exe] The -w option does not support Chinese filename #505
Comments
Thanks for this. I am unable to reproduce the problem. On my Ubuntu machine, when I start with your file, latexindent.pl -w 新建.tex -g issue-505.log -y 'onlyOneBackUp:1' then the log file is
Please can you provide more details? |
My OS: Windows 10 22H2 19045.3803 (Chinese version) When I run
then the log file is
|
What happens if your file is named |
The process completed successfully, generating aaaa.bak0. |
How does the o switch behave? Can you post the output from
|
INFO: latexindent.pl version 3.23.5, 2024-01-01, a script to indent .tex files |
According to the code in #263 (comment)
In the Chinese version of Windows, it appears that perl receives commands from cmd encoded in GB2312 instead of utf-8. Therefore, you need to use a command like this to convert the encoding: decode("GB2312", ${$self}{fileName} ) And when it comes to file operations, the string needs to be converted back to GB2312 encoding. Such as:
The following example confirms this. If BackUpFileProcedure.pm is changed to the following file When I run
the bak file is generated as normal and the log file is
Therefore, I believe that you can refer to #263 and |
That's helpful many thanks. |
For my reference, this file will need updating https://github.com/cmhughes/latexindent.pl/blob/main/.github/workflows/batch-check.yaml |
Implemented as of f75a818 Please leave this open until I have released it. |
Thanks again, released at https://github.com/cmhughes/latexindent.pl/releases/tag/V3.23.7 |
Please provide the following when posting an issue:
新建.tex code
test.
actual/given output
D:\test>latexindent -w "新建.tex"
FATAL Could not write to backup file ./�½�.bak0. Please check permissions.
Exiting, no indentation done.
The text was updated successfully, but these errors were encountered: