SC filetype fails for some file extensions

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
pirgygab
Posts: 25
Joined: 05 Feb 2013 23:07

SC filetype fails for some file extensions

Post by pirgygab »

filetype() fails for a UTF-8 BOM file if its extension is something like ".log" but not included in the list that I found in the topic http://www.xyplorer.com/xyfc/viewtopic. ... f+8#p56064 (i.e. txt, css, xml…).
text filetype(<curitem>); returns "Ascii" if selected file is file.log and "UTF-8 BOM" if it is renamed file.txt.

Note:
• The same behaviour can also be noticed in Info Panel - Raw view. Floating Preview and Info Panel - Preview give always the good encoding type.
• For UTF-8 BOM, an extra "." is displayed in 1st position in Floating Preview or Info Panel – Preview
• For UTF-16xx, the encoding is correctly returned, regardless of the file extension.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC filetype fails for some file extensions

Post by admin »

Confirmed and fixed.
pirgygab wrote:• For UTF-8 BOM, an extra "." is displayed in 1st position in Floating Preview or Info Panel – Preview
Not sure what you mean.

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: SC filetype fails for some file extensions

Post by Borut »

admin wrote:
pirgygab wrote:• For UTF-8 BOM, an extra "." is displayed in 1st position in Floating Preview or Info Panel – Preview
Not sure what you mean.
I believe it is the following:
PreviewDotWhenUtf8BOM.jpg
To see the attached files, you need to log into the forum.
Win 10 Pro 64bit

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC filetype fails for some file extensions

Post by admin »

Borut wrote:
admin wrote:
pirgygab wrote:• For UTF-8 BOM, an extra "." is displayed in 1st position in Floating Preview or Info Panel – Preview
Not sure what you mean.
I believe it is the following:
PreviewDotWhenUtf8BOM.jpg
This does not happen here!

So this API works differently according to the locale? Shocking...

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: SC filetype fails for some file extensions

Post by Borut »

My current environment:

OS: Windows XP Professional (Service Pack 3), 32-bit (5.1)
Themes: No
System Locale ID: 3079
Thread Locale ID: 3079
Default ANSI Code Page: 1252
Active Code Page: 1252 (ANSI - Lateinisch I)
DBCS Code Page: No

You sure you are testing with an UTF-8 BOM file? We all know that BOM is superfluous with UTF-8, but still, when it is there, then dot in preview should not be seen.
Win 10 Pro 64bit

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC filetype fails for some file extensions

Post by admin »

I tried something. Check next version...

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: SC filetype fails for some file extensions

Post by Borut »

admin wrote:So this API works differently according to the locale? Shocking...
Ooooops, shocking indeed! I can now confirm that v12.10.0003 indeed does NOT have this problem in, for example, the following environment:

OS: Windows XP Home Edition (Service Pack 3), 32-bit (5.1)
Themes: No
System Locale ID: 1050
Thread Locale ID: 3079
Default ANSI Code Page: 1252
Active Code Page: 1250 (ANSI - Mitteleuropa)

DBCS Code Page: No

v12.10.0004 also does not have this problem in the upper environment.

Unfortunately, the new v12.10.0004 still has the problem in the following environment (as the v12.10.0003 did):

OS: Windows XP Professional (Service Pack 3), 32-bit (5.1)
Themes: No
System Locale ID: 3079
Thread Locale ID: 3079
Default ANSI Code Page: 1252
Active Code Page: 1252 (ANSI - Lateinisch I)

DBCS Code Page: No

:shock: :? :(
Win 10 Pro 64bit

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC filetype fails for some file extensions

Post by admin »

So nothing changed between v12.10.00043 and v12.10.0004? Hm.

What are these numbers in words? Croatian?
System Locale ID: 1050
Thread Locale ID: 3079

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: SC filetype fails for some file extensions

Post by Borut »

admin wrote:So nothing changed between v12.10.00043 and v12.10.0004? Hm.

What are these numbers in words? Croatian?
System Locale ID: 1050
Thread Locale ID: 3079
Apparently nothing changed, yes (the problematic environment was retested remotely, however, but I do not think that that makes a difference).

I am surprised that I experience problems in the environment which appears "more normal/usual" to me.

I guess that 1050 is Croatian - I have it here selected under Regions- und Sprachoptionen / Erweitert / Sprache für Programme, die Unicode nicht unterstützen. I guess that 1050 comes from there. Directly under Regionale Einstellungen I have Deutsch (Österreich) selected.

Am not willing to change and reboot at the moment. Also am at the moment not willing to try the MS tool you have suggested in the morning.

EDIT: Here a list of the locale codes: http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx
Win 10 Pro 64bit

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC filetype fails for some file extensions

Post by admin »

I managed to set these locales in Win7:

System Locale ID: 1050
Thread Locale ID: 1031
Default ANSI Code Page: 1252
Active Code Page: 1250 (ANSI - Osteuropa)
DBCS Code Page: No

Result: No problems.

I did not manage to set Austria:
Thread Locale ID: 3079

But I doubt this can be the cause.

So: It remains a mystery! (I will not further investigate it)

Post Reply