android-file-transfer-linux
android-file-transfer-linux copied to clipboard
Special characters in filenames are not escaped and fail to transfer
Steps to repro:
- Create text file with a name such as "Any News?.txt", "More|Power.txt", "Cool*Party.txt", or "Double "Quotes".txt"
- Attempt to upload file to android device
Result: Sometimes file silently fails to copy. Sometimes UI hangs, especially when copying multiple files.
Expected behavior: Files with ?, |, *, or " in the name will upload to device just like every other file
(To be fair, my distro's version of gvfs-mtp also appears to have this bug.)
I don't think it's possible to upload such files, as PTP does not say anything about object names (from PTP perspective they are not files, but rather just arbitrary names), but I double check the spec. And also investigate why UI freezes. :grimacing: Nice find, thanks!
Found this https://stackoverflow.com/questions/2679699/what-characters-allowed-in-file-names-on-android
I wonder what's the best behaviour for those. I don't want to replace with something static, like space, maybe u<utf16 in hex>
or x<ascii code in hex>
would do? for instance ?
would be x3f