Bangle backup does not work if filenames contain umlauts.
Closed this issue · 4 comments
Console contains:
<COMMS> showMessage "Backing up..."
comms.js:432 Uncaught (in promise) URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Array.map (<anonymous>)
at comms.js:432:25
Thanks - is there some app that's generating files with umlauts, or was it just something you uploaded via the IDE?
Just to check - these are going to the characters with char codes between 128..255 (not unicode or anything). It sounds like the issue is probably when trying to write the named file into a zip, so maybe we should just change any char codes above 128 to ? or similar
This was by caused by uploading GPX files for GPS Trekking so the umlaut initially came from the local file name of the .gpx. The IDE seems to somehow specially handle these file names as they were displayed in quotes in the file overview. Easy enough to avoid if known but inconvenient.
I'll have to check later what char codes actually result after uploading and if this differs between IDE and GPS Trekking, since the system I uploaded the files from has set unicode locales everywhere.
Upload of a file named TestÄßê.trf via IDE and GPS Trekking creates the same file name on the bangle.
Storage.list() shows it as "Test\xC4\xDF\xEA.trf"
So yes, seems to be only extended ASCII. Replacing those with ? would help, but restoring those backups of course would be not really identical to the original. Maybe that would cause problems with some apps that store filenames while most should handle the case of a file going missing.
Both print(require("Storage").read("Test\xC4\xDF\xEA.trf")) and print(require("Storage").read("TestÄßê.trf")); work fine when sent from the IDE to RAM.
Closing now - I think this may have been fixed (apart from if the ZIP can't represent the filename) but hopefully the lack of storage errors now means this is a lot better