Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to count number of bytes in tag field including double if Unicode? (Read 4119 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to count number of bytes in tag field including double if Unicode?

Salut to all!

My Sansa Clip+ portable player handle well UTF-8, but have path length limit, 192 characters. Double-byte characters counts as 2.

For copying files to Sansa I want to cut long file names. I must to know the character length, but there's a probleme: functions $len() and $len2() give the same result! Both in Playlist view and File operations > Copy to.

For example, file name: 04. Cinquetti, Gigliola - Quelli erano i giorni [Дорогой длинною. Azok a szép napok. Those were the days. The long road].mp3

$len(%filename%)=120
$len2(%filename%)=120

It seems as bug in foobar.  Or in my system? (WinXP SP3, foobar 1.3 beta 5, default user interface)
Thanks in advance for any help.

How to count number of bytes in tag field including double if Unicode?

Reply #1
The $len2() function is obsolete and it's now an alias for the regular $len() function. But it was not about counting bytes in the unicode characters (which could be up-to 4 bytes per character) but counting display widths. Regular characters counted as one and fullwidth characters, found in asian languages for example, counted as two.

How to count number of bytes in tag field including double if Unicode?

Reply #2
Case
Thank you very much for quick answer.

Sorry.

Total Commander and Mp3tag have no way to handle it, too. The only one is PHP, but I have no time to write it.

Do anybody know another solution, maybe workaround? (Convert non-latin to latin is not a way for me - I always want to enjoy the big power of the richest in the world language - hungarian.)

How to count number of bytes in tag field including double if Unicode?

Reply #3
My Sansa Clip+ portable player handle well UTF-8, but have path length limit, 192 characters. Double-byte characters counts as 2.
Do anybody know another solution, maybe workaround? (Convert non-latin to latin is not a way for me - I always want to enjoy the big power of the richest in the world language - hungarian.)
Limit your number of characters to 96.
It's only audiophile if it's inconvenient.

How to count number of bytes in tag field including double if Unicode?

Reply #4
Limit your number of characters to 96.

Or I may use a gramophon, instead...
And only 1% is longer, than 192. Now I edit them manually... but it is time consumable.

How to count number of bytes in tag field including double if Unicode?

Reply #5
you could try installing rockbox on your sansa clip+.

 

How to count number of bytes in tag field including double if Unicode?

Reply #6
you could try installing rockbox on your sansa clip+.


Thank you for the tip! It seems highly configurable, yes, but...

For music listening-handling I use foobar2000, Mp3tag and Total Commander (and Sansa for walking). Now they all serve well my needs, but it was a very big time to learn all their nuances, limits, and construct a good system. Sansa has only this one, not very big limitation (for me). To try a new system, find its implicit limits, learn to use it - it is much quicker to write a PHP page to handle the file name's length.