Hello, dear XYplorer Community!
If the file extension is not "txt",
the filetype() seems not to distinguish correctly between encodings "ASCII" and "UTF-8".
Please check it.
filetype() - ASCII - UTF-8
Forum rules
READ THIS AND DO IT!!!
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%).
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.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
READ THIS AND DO IT!!!
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%).
-
admin
- Site Admin
- Posts: 66621
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: filetype() - ASCII - UTF-8
Wrong! See below...
FAQ | XY News RSS | XY X
-
highend
- Posts: 14992
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: filetype() - ASCII - UTF-8
Then the recognition doesn't seem to be working correctly
The .log file isn't recognized correctly, while the .txt file is.
Both extensions are ticked in the Text Files category!
Code: Select all
$file1 = "%TEMP%\~test.log";
$file2 = "%TEMP%\~test.txt";
writefile($file1, "¥", , "utf8");
writefile($file2, "¥", , "utf8");
text "1: " . filetype($file1) . <crlf> . "2: " . filetype($file2);
Both extensions are ticked in the Text Files category!
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 66621
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: filetype() - ASCII - UTF-8
Whoops, my fault. It's not "Text Files", it's "UTF-8 Files", a category that's not exposed to the user.
Anyway, I decided to make SC filetype work as advertised and go ONLY by content, not by extension. Next beta...
Anyway, I decided to make SC filetype work as advertised and go ONLY by content, not by extension. Next beta...
FAQ | XY News RSS | XY X
-
zakhar
- Posts: 179
- Joined: 08 Sep 2010 21:13
-
jupe
- Posts: 3462
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: filetype() - ASCII - UTF-8
I assume because of whatever changes you made regarding this topic, there has been a side effect:
Code: Select all
$file1 = "%TEMP%\~test.log";
writefile($file1, "™", , "utf8");
text runret("cmd /c chcp 65001 & type ""$file1""",, 65001);
delete 0, 1, $file1;
-
admin
- Site Admin
- Posts: 66621
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: filetype() - ASCII - UTF-8
Actually it was caused by the UTF-8 related changes in v23.00.0102 - 2022-04-22 15:24. Fix comes. 
FAQ | XY News RSS | XY X
XYplorer Beta Club