[swift-evolution] [Pitch] Remove transparent bridging between Swift strings and char *

Ben Rimmington me at benrimmington.com
Wed Jun 22 14:37:00 CDT 2016


> On 22 Jun 2016, at 20:02, Kenny Leung via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I think it would be OK if the transparent bridging called cString(using:) itself, and the whole thing would fail if the conversion fails.

But the cString(using:) method is from Foundation, and using UTF-8 should always succeed in any case.

UTF-8 by default is probably correct for POSIX APIs, but maybe not for Windows APIs (if code pages are expected).

-- Ben


More information about the swift-evolution mailing list