1

I am seeing inconsistent behavior with the open source release of Swift 3 compared with the version that shipped with Xcode 8 with the String instance method removingPercentEncoding:

let testString = "valid àæ"
let escapedString = testString.removingPercentEncoding

In Xcode, the result of escapedString is "valid àæ". However the open source version of Swift returns "valid à" (missing æ).

Try it online.

What am I missing?

JAL
  • 41,701
  • 23
  • 172
  • 300
  • 1
    It's worth noting that the IBM Swift Sandbox is running the Linux version of Swift, which is a different implementation from the Xcode version. So it's more likely to be a "Linux vs. MacOS" thing than an "Xcode vs. open source" thing. – TheSoundDefense Oct 26 '16 at 17:09

1 Answers1

0

This was due to a bug where CFStringGetLength would return an incorrect value for non-latin characters. _CFStringCreateByAddingPercentEncodingWithAllowedCharacters and _CFStringCreateByRemovingPercentEncoding are now fixed.

SR-3052

Foundation PR #706

JAL
  • 41,701
  • 23
  • 172
  • 300