[Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the name

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *ghisler(Author) »

I can confirm the problem. I was using a 259 character buffer for the UTF-8 representation of the loaded strings.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9400
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *Dalai »

But the names are truncated long before the limit of 259 is reached. It doesn't match if I consider 2 or 4 bytes per character. What am I missing?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *ghisler(Author) »

The string length was chosen for ANSI names, because a name in a directory can't be longer than 255 characters. However, Unicode (UTF-16) names on NTFS can also be 255 characters long - and converted to UTF-8, it can be much longer than 255 characters.

For example, the Japanese file name from this bug report would take 364 characters when saved as UTF-8.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *ghisler(Author) »

This should be fixed in beta 9, please try it!
Author of Total Commander
https://www.ghisler.com
Vulpix
Junior Member
Junior Member
Posts: 28
Joined: 2013-05-15, 18:06 UTC

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *Vulpix »

ghisler(Author) wrote: 2023-06-30, 08:11 UTC This should be fixed in beta 9, please try it!
Works fine now, much appreciated! (I also tried with the "original" utf16-LE as well as utf-8 and both work fine, so the utf8 behavior is unchanged and utf16-LE is fixed).
User avatar
Dalai
Power Member
Power Member
Posts: 9400
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [Might be a TC (seems any version) bug - Multi-rename tool ] Loading long unicode names from UTF16-LE truncates the

Post by *Dalai »

Can confirm it's fixed.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply