Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters in filenames are not escaped and fail to transfer #332

Open
Mycohl opened this issue Jul 7, 2023 · 2 comments
Open

Comments

@Mycohl
Copy link

Mycohl commented Jul 7, 2023

Steps to repro:

  1. Create text file with a name such as "Any News?.txt", "More|Power.txt", "Cool*Party.txt", or "Double "Quotes".txt"
  2. 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.)

@whoozle
Copy link
Owner

whoozle commented Jul 12, 2023

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. 😬
Nice find, thanks!

@whoozle
Copy link
Owner

whoozle commented Jul 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants