- Status Closed
- Percent Complete
- Task Type Patches
- Category Drivers
- Assigned To No-one
- Operating System All players
- Severity High
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#5736 - Correctly handle files with long names containing non-latin characters
Correctly handle files with long names containing non-latin characters (more precisely: files whose names, when utf8 encoded, require more than 255 bytes). This avoids player freeze when such files are present in the file system.
The patch does the following. When reading a entry for a file with long name, the name is first utf8-decoded into a temporary buffer. Then the check is made whether the content of the buffer would fit into the dir entry. If not, the long name is ignored and the short DOS name (which is OEM encoded) is used instead.
Beware: If this short name contains characters from the upper half of the code page, that name may appear with strange glyphs or empty character in the file browser. This is because Unicode characters 0×80 to 0x9F are control characters. They can’t be displayed.
2006-07-31 23:00
Reason for closing: Accepted
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
P.S.
Please use spaces instead of
tabs in RB code.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
1. Please use diff -u next time.
2. Please avoid submitting only-whitespace changes.
The fixed patch is attached, later I’ll actually compile it.
I created a bad long file name that crashed the sim when viewing it, but the patch didn’t solve it.
Please check it on your sim.
Sorry for the whitespace changes. My editor stripped trailing spaces when files were saved. I changed the editor configuration.
To the problem: is fat.c used in simulator builds? I haven’t found fat.o in the sim build directory. In the normal (=not sim) build fat.o is present (in firmware/drivers). So the patch may have no effect in the sim build.
A better version of the patch: requires significantly less stack space. Also the padding FAT characters are handled correctly. Works well for me (iriver H1xx).
I like it. One small thing: please try to keep the source code lines shorter than 80 characters.
Ok, I will in the future. I won’t correct this patch since there are many lines longer than 80 chars in fat.c anyway.
I’m ready to commit this patch;
I need your real name to do so.
Here is a slightly improved patch (yet better handling of long name padding; made the function static)
My name is Alexander Levin