Page 1 of 1

SC filetype fails for some file extensions

Posted: 10 Feb 2013 22:26
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.

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 14:22
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.

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 15:47
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

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 15:49
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...

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 15:54
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.

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 16:19
by admin
I tried something. Check next version...

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 19:08
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: :? :(

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 19:16
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

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 19:36
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

Re: SC filetype fails for some file extensions

Posted: 12 Feb 2013 21:31
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)