Browse Source

MacOS: Fixed a bug parsing local file URLs containing URL escape characters

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
81e206f963
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm

+ 6
- 2
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -207,8 +207,12 @@ private:
auto addURLResult = [&chooserResults] (NSURL* urlToAdd)
{
auto scheme = nsStringToJuce ([urlToAdd scheme]);
auto path = nsStringToJuce ([urlToAdd path]);
chooserResults.add (URL (scheme + "://" + path));
auto pathComponents = StringArray::fromTokens (nsStringToJuce ([urlToAdd path]), "/", {});
for (auto& component : pathComponents)
component = URL::addEscapeChars (component, false);
chooserResults.add (URL (scheme + "://" + pathComponents.joinIntoString ("/")));
};
if (isSave)


Loading…
Cancel
Save