Image converting does not work if path does contain non-English letters

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

User avatar
enthusiast
Posts: 7
Joined: Fri Jul 14, 2023 4:04 pm

Image converting does not work if path does contain non-English letters

Post by enthusiast »

If file "filelist.txt" contains paths with letters other than English, such as Chinese or Arabic, like "D:\files\习近平.jpg", the convertation of images, located on these paths, will not work.

XnConvert has a similar problem; such images are not loaded into preview window and do not participate in convertation.

XnViewMP handles such paths normally and converting happens!

Is it possible to add support for such letters in Nconvert and XnConvert as well?

Nconvert: 7.136
XnConvert: 1.98
System: Windows 10 x64, en.
cday
XnThusiast
Posts: 4021
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Image converting does not work if path does contain non-English letters

Post by cday »

Pierre was developing an NConvert version with better Unicode support earlier in the year, but unfortunately the link to the test version that he produced, which was reported to work for Korean characters, is no longer available... :(

Maybe in the next update?
User avatar
xnview
Author of XnView
Posts: 43833
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Image converting does not work if path does contain non-English letters

Post by xnview »

you can try the unicode beta version
Pierre.
User avatar
enthusiast
Posts: 7
Joined: Fri Jul 14, 2023 4:04 pm

Re: Image converting does not work if path does contain non-English letters

Post by enthusiast »

I tried beta version, but I get error again.

File filelist.txt:

Code: Select all

D:\file 1.png
D:\file روز.png
Command:

Code: Select all

nconvert.exe -l filelist.txt -q 90 -D -out webp
Result:

Code: Select all

Conversion of D:\file 1.png into D:\file 1.webp OK
  Error: Can't open file (D:\file روز.png)
cday
XnThusiast
Posts: 4021
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Image converting does not work if path does contain non-English letters

Post by cday »

If you don't use a filelist and run something like this:

Code: Select all

nconvert.exe -q 90 -D -out webp روز.png
?
User avatar
enthusiast
Posts: 7
Joined: Fri Jul 14, 2023 4:04 pm

Re: Image converting does not work if path does contain non-English letters

Post by enthusiast »

In this case, conversion works, although it outputs question marks instead of file name in Terminal:

Code: Select all

>nconvert.exe -out webp روز.png

Conversion of ???.png into ???.webp OK
In file system the file is written with a normal name: روز.webp
cday
XnThusiast
Posts: 4021
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Image converting does not work if path does contain non-English letters

Post by cday »

The fact that the modified code runs suggests that there was a problem with the file list coding, doesn't it?

Maybe Pierre can help with the above 'question marks' issue...

Edit: Can you upload a small test file?
User avatar
enthusiast
Posts: 7
Joined: Fri Jul 14, 2023 4:04 pm

Re: Image converting does not work if path does contain non-English letters

Post by enthusiast »

As far as I know, encoding of my filelist.txt is UTF-8.
I've attached my example as an archive. There are three files: abc.png, روز.png, FL.txt. I can upload them separately if archives are not allowed here.
My command when I'm inside a folder:

Code: Select all

>nconvert.exe -l FL.txt -out webp
Conversion of abc.png into abc.webp OK
  Error: Can't open file (روز.png)
But when the file is run directly conversion works, although it outputs question marks instead of file name in Terminal:

Code: Select all

>nconvert.exe -out webp روز.png

Conversion of ???.png into ???.webp OK
In file system the file is written with a normal name: روز.webp
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 43833
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Image converting does not work if path does contain non-English letters

Post by xnview »

enthusiast wrote: Sat Jul 15, 2023 12:58 pm I tried beta version, but I get error again.

File filelist.txt:

Code: Select all

D:\file 1.png
D:\file روز.png
could you send me the filelist.txt file?
Pierre.
cday
XnThusiast
Posts: 4021
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Image converting does not work if path does contain non-English letters

Post by cday »

It is in the ZIP, isn't it, or do you need something else?
User avatar
xnview
Author of XnView
Posts: 43833
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Image converting does not work if path does contain non-English letters

Post by xnview »

cday wrote: Mon Jul 17, 2023 1:51 pm It is in the ZIP, isn't it, or do you need something else?
Please try this version
Pierre.
User avatar
enthusiast
Posts: 7
Joined: Fri Jul 14, 2023 4:04 pm

Re: Image converting does not work if path does contain non-English letters

Post by enthusiast »

xnview wrote: Tue Jul 18, 2023 8:00 am Please try this version
It's working now, thank you!

Code: Select all

>nconvert.exe -l FL.txt -out webp
Conversion of abc.png into abc.webp OK
Conversion of ???.png into ???.webp OK
Conversion of def.png into def.webp OK
The file is saved with the name روز.webp, so the question marks in the console don't bother me. :D

Hopefully this feature will be included in the next versions of XnConvert and Nconvert...
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Image converting does not work if path does contain non-English letters

Post by dedbombom »

xnview wrote: Tue Jul 18, 2023 8:00 am
cday wrote: Mon Jul 17, 2023 1:51 pm It is in the ZIP, isn't it, or do you need something else?
Please try this version
I know that this is beta version but I found out that it can't compress/process (can save png to avif but can't avif to avif) avif images ("my_error_exit...<Not a JPEG file: starts with 0x00 0x00> Error: Don't know how to read this picture" if "-in avif" command used shows only this message "Error: Don't know how to read this picture") but previous version (7.136) works fine. Also another problem that to make it work for/to jpeg-xl compression latest libJPEGXL.dll from XnView MP v1.53 needed or this don't works (in console/cmd shows that all OK but for real file is not creating) and in v7.136 (non Unicode) saving any images to jpeg-xl not working at all while in v7.121 it worked fine.
Commands used for avif:
nconvert.exe -v -32bits -out avif -o 2.avif" -avif_speed 8 -avif_quant_color 0 25 30 -avif_quant_alpha 0 25 30 -in avif "1.avif"
nconvert.exe -out avif -o "2.avif" "1.avif"
P.S. All needed plugins placed in plugins folder. Probably bug related to that problem viewtopic.php?f=57&t=43732 (and Unicode version don't have it fixed).
User avatar
xnview
Author of XnView
Posts: 43833
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Image converting does not work if path does contain non-English letters

Post by xnview »

dedbombom wrote: Fri Aug 25, 2023 4:47 pm Commands used for avif:
nconvert.exe -v -32bits -out avif -o 2.avif" -avif_speed 8 -avif_quant_color 0 25 30 -avif_quant_alpha 0 25 30 -in avif "1.avif"
nconvert.exe -out avif -o "2.avif" "1.avif"
P.S. All needed plugins placed in plugins folder. Probably bug related to that problem viewtopic.php?f=57&t=43732 (and Unicode version don't have it fixed).
yes will be fixed
Pierre.