Hello,
I am using UIDocumentInteractionController to share custom documents from my app.
When prodividing an URL to a local file path containing characters with accents, it will failed right after the user choose a sharing option.
This problem happens on 10.3, but works perfectly in iOS 9.3.5.
My app is mainly written in C++14, and uses UTF-8 encoding for strings.
I do the following:
NSURL* fileURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:rPath.GetChars()] isDirectory:!rPath.IsLeaf()];
mpDocController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];Which gives this error, after a sharing method/option is selected (for example, e-mail):
Couldn't get file size for file:///var/mobile/Containers/Data/Application/FEEF7EA0-E4C5-4EC0-9A03-BB4BFF169729/Documents/Sessions/lo%CC%8
2o%CC%88o%CC%84%C5%93o%CC%83l/lo%CC%82o%CC%88o%CC%84%C5%93o%CC%83l.bm3: Error Domain=NSCocoaErrorDomain Code=260
"The file “lôöōœõl.bm3” couldn’t be opened because there is no such file."
UserInfo={NSURL=file:///var/mobile/Containers/Data/Application/FEEF7EA0-E4C5-4EC0-9A03-BB4BFF169729/Documents/
Sessions/lo%CC%82o%CC%88o%CC%84%C5%93o%CC%83l/lo%CC%82o%CC%88o%CC%84%C5%93o%CC%83l.bm3,
SFilePath=/var/mobile/Containers/Data/Application/FEEF7EA0-E4C5-4EC0-9A03-BB4BFF169729/Documents/S
essions/lôöōœõl/lôöōœõl.bm3,If the path contains any characters with accents, it will fail. However, with regular characters it works fine.
I have tried multiple things, like escaping the NSString before creating the NSURL but I get the same results.
The 'GetChars()' method will return a UTF8 const char*. The path is valid, the file exists and can be read without any problem.
Is this a known 10.3.x or 10.x.x issue?
Any help would be greatly appreciated.
Thank you,
Mathieu.