UTF-16LE encoded PaperFolders and Irfanview

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
klownboy
Posts: 4452
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by klownboy »

Nice work totmad1. It's good to know that Irfanview doesn't have a problem with paperfolders being encoded UTF-16LE as long as you are making the image selection from the listing in the text files. It's when you use the Irfanview command line switch "/filelist=blablabla" to point to the a paperfolder (encoded to UTF-16LE) that is a problem for Irfanview.

totmad1
Posts: 131
Joined: 24 Jun 2013 12:37

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by totmad1 »

i have been doing further tests and have found an inconsistent problem with "!=".
it may just be my pc so i have found a workaround.
replace "

Code: Select all

 if($ext !="jpg" OR $ext !="bmp" OR $ext !="png"){$image_list = "";}
with

Code: Select all

if(($ext =="jpg" OR $ext =="bmp" OR $ext =="png")==0) {$image_list = "";}
totmad1 (totally mad one)

klownboy
Posts: 4452
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by klownboy »

Hi totmad1, have you tried using "LikeI" or in this case, "UnLikeI"? Something like this (no pun intended)...untested...

Code: Select all

	   if ("|jpg|bmp|png|" UnLikeI *|$ext|*) {$image = ""; }

highend
Posts: 14745
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by highend »

Did I mention that I like regexmatches even for comparisons? xD

Code: Select all

if !(regexmatches($ext, "(jpg|bmp|png)")) { $image = ""; }
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4452
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by klownboy »

No highend, aka MrRegEx, I don't believe you've ever mentioned that. :kidding:
highend wrote:Did I mention that I like regexmatches even for comparisons? xD

totmad1
Posts: 131
Joined: 24 Jun 2013 12:37

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by totmad1 »

Hi klownboy & highend
Am really happy to be introduced to your two methods , have made special note.
have to even admit to understanding MrRegEx 's without lookup in help file. must be starting to sink in.
one question for you Ken i haven't been able to find in my documentation your use of " *|"
I've tested timings and found other than a couple of anomalies no speed differences in all three methods.
totmad1 (totally mad one)

highend
Posts: 14745
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by highend »

one question for you Ken i haven't been able to find in my documentation your use of " *|"
* is the wildcard.

"|jpg|bmp|png|" UnLikeI *|$ext|*

He uses the "*|" and "|*" it to make sure that a match is exact and that it can be anywhere inside the pattern "|jpg|bmp|png|".

I've used this kind of comparison in the past but it's not easy to read and error prone (just forget one | and you can get weird results).
One of my scripts helped you out? Please donate via Paypal

totmad1
Posts: 131
Joined: 24 Jun 2013 12:37

Re: UTF-16LE encoded PaperFolders and Irfanview

Post by totmad1 »

A BIG THANKS to you highend really appreciate your time & trouble.
I had thought that the * was for the wildcard in this case but was confused with the format.
I've done a further search using grep and found only two other scripts using this format but contained in quotes.
Again real appreciation and thanks. :beer: :beer: :beer: :beer:
totmad1 (totally mad one)

Post Reply