UnicodeTest/LockedTest

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

UnicodeTest/LockedTest

Post by *Alextp »

This content plugin allows to check:
1. is filename Unicode or ANSI (on Windows NT/2000/XP systems);
2. is file locked by another task or not.

http://www.totalcmd.net/plugring/UnicodeTest.html
Last edited by Alextp on 2011-09-29, 08:23 UTC, edited 3 times in total.
User avatar
petermad
Power Member
Power Member
Posts: 14806
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

BTW, should I put it to Totalcmd.net? IMHO plugin is very small for it.
Of course you should - it is not small for the ones who need it!
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

There is nothing worse than tools and plugins that nobody knows of, so better release everything, no matter how useful or useless it is.
There will always be at least one person who needs it. :)

Icfu
This account is for sale
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

Thanks for this plugin, Alextp!

Could you add a column, which states the character encoding in the follwing manner?

Code: Select all

'Script for Script Content Plugin
'(c)Lev Freidin, 2005

strChrEnc = "ASCII-7"
For i = 1 to Len(filename)
   intZn = AscW(Mid(filename, i ,1))
   If intZn > 255 Then
      strChrEnc = "Unicode"
      Exit For
   ElseIf intZn > 127 Then
      strChrEnc = "ASCII-8"
   Else
      'NOP
   End If
Next

content = strChrEnc
Would be useful in order to check, if problems with some archivers might occur.

Example: The "€"-symbol is ANSI-coded (x'80'), but ZIP will replace this character by "_". Unicode for "€" is x'20AC' (>x'FF'), so result for the new plugin column should be "Unicode" (while existing column reports "ANSI").

Isn't that reliable. Char "ƒ" (ANSI x'83', Unicode x'0192') for instance will result in "Unicode". Bit ZIP handles this char correct, because it is present in westeuropean DOS encoding). I'am afraid, that it would be too much work to recognize, if all characters of a given filename fits a certain encoding / codepage, wouldn't it?

Thanks!
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2van Dusen
Sorry, I didn't understand how function "AscW" works in the script.
AscW(0x80)=0x20AC and
AscW(0x83)=0x0192, right?
How to write this function in Pascal/C?

And, if you want to catch characters in filename that will be replaced by ZIP to '_', you should know, what function ZIP uses for that detection exactly. As you wrote, it's not "AscW(char)>255"...
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

errr... It shows all folders and filenames in my computer are ANSI (I searched).
So... How to rename them to unicode? I tried use explorer, doesn't work either.
Any tips would be appreciated. Thanks a lot.
CoolWater
Power Member
Power Member
Posts: 737
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

Alextp wrote: Sorry, I didn't understand how function "AscW" works in the script.
Small extract from the VB Help file...
The AscW function returns the Unicode character code except on platforms where Unicode is not supported, in which case, the behavior is identical to the Asc function.
HTH
CoolWater
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2KevinMo
To have Unicode, you must have Win2k/XP, because Unicode API is fully supported only by these OS.

Open Character Map (charmap.exe), select some chars from different encodings (use chars from the end of map) and paste them while renaming file in Explorer - file will be in Unicode. To ensure it's in Unicode, try to open it by F3 - TC must show error: "File not found". If F3 gives no error, then file has accessible short name and TC uses it.

You may need to copy Unicode file to different folder so it will not have accessible short name. E.g. I needed to copy file from C: to D:, so copy will not have short name like source.
Last edited by Alextp on 2006-01-16, 17:36 UTC, edited 1 time in total.
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

2CoolWater
I'll try to read VB help. But I don't think this AscW function will help us. If you want to search for chars that will be renamed by ZIP, you need not AscW, but real functrion used by ZIP (maybe you need to read ZIP source).
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

2Alextp
Thanks for your explanation. Seems there would be more trouble using unicode filenames in TC ^_^
Great plugin!
User avatar
frenky
Senior Member
Senior Member
Posts: 250
Joined: 2005-07-30, 19:36 UTC

Post by *frenky »

2Alextp
N1 mate!! This one is of real usfe for me.

Now, possible bug :)

To reproduce you need few files with unicode chars and:
1. Sort by name for reference.
2. Sort by custom column.
3. Move focus from TC, return to TC and list is sorted diferntly...
Image: http://img458.imageshack.us/img458/3619/untitled9wy.jpg

Is sorting of custom coulmns implemented fully at all?
I remember there were some word on the forum about custom columns and sorting, I've tried to find it but...

TC is 6.53.
[Edit]
woops:)
in the image 2. and 3. should be changed :)
Ambiguity succeeds where honesty dares not venture.
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Update:
16.01.06: added detection of "Partial Unicode" names

2frenky
It looks like a bug in TC sorting by custom columns. You should show this bug to Ghisler.
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Update:
30.01.06: added field "Locked test", plugin name changed

Download

Now it's possible to find files by Alt+F7 that are locked by other tasks or TC. Then you may unlock such files using Unlocker (http://ccollomb.free.fr/unlocker).
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2Alextp
Nice plugin indeed! One small (?) request: another field, that shows the application that locks that particular file! How about that?
I switched to Linux, bye and thanks for all the fish!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

 
 
 
 
well, THAT would be awesome.



acctualy, don't need 3th field, just put the name of the app in place where you stored "locked" string... live it empty if it is not.


we will search for <> empty string if we want to find only locked files and vice versa if we don't
Post Reply