CJK image name not correctly passed to IrfanView

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

CJK image name not correctly passed to IrfanView

Post by *yyang »

My environment:

- Windows 10 64-bit, Simplified Chinese edition.
- IrfanView 4.54 32-bit.
- IView=1, IviewAdditionalTypes=*.jfif *.webp

Steps to reproduce:

1. Create an image named 〜.jfif or 〜.webp.
2. Neither Lister nor Quick View displays it correctly.

These images display correctly:

- Of a "known type" (not in IviewAdditionalTypes), e.g. 〜.jpg.
- Of an ASCII name or an "ordinary" CJK name, e.g. 好.webp. It seems that the codepoint of 〜 is in a different range.

I guess this issue is not specific to 9.51 RC3, but haven't tested an older version.
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: CJK image name not correctly passed to IrfanView

Post by *ghisler(Author) »

Unfortunately to my knowledge Irfanview doesn't support Unicode in this function.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: CJK image name not correctly passed to IrfanView

Post by *yyang »

@ghisler You mean the IviewAdditionalTypes part of IrfanView's API (or the equivalent) or anything else? I can directly open 〜.jfif and 〜.webp with IrfanView from both Explorer and Total Commander.

And judging from IrfanView's release history (https://www.irfanview.com/history_old.htm, https://www.irfanview.com/main_history.htm), it's been Unicode ready since v4.51, Feb 2018. No mention of Unicode in later versions.
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: CJK image name not correctly passed to IrfanView

Post by *ghisler(Author) »

The problem seems to be the character 〜: TC determines by converting a name to ANSI and back to Unicode whether it needs to send a file name to Irfanview as ANSI or Unicode (because older Irfanview versions only supported ANSI). Apparently 〜 is converted to ~ and back to 〜 for some unknown reason, so TC assumes that it can send the ANSI version ~. Currently I don't see any way to resolve this.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: CJK image name not correctly passed to IrfanView

Post by *yyang »

Thanks for your answer! But why a "known type" image like 〜.jpg, 〜.png, etc. can be correctly displayed by Lister and Quick View? I think IviewAdditionalTypes only affects the extensions of images passed to IrfanView, right?

It's a bit of a shock that this conversion and comparison passes... On my laptop (Windows 10 64-bit, Simplified Chinese edition), WideCharToMultiByte(CP_ACP, 0, _T("〜"), ...) returns a "?" (U+003F), the system default character. And I fail to convert it back to "〜" with MultiByteToWideChar().

It also occurs to me that IrfanView 4.51, its first Unicode ready version, is 2 years old now. Maybe it's time to simplify TC's help a little bit? :)
#147523
Post Reply