Swift 5 UTF-16 To UTF-8, what does it mean to Silver

Hi,

I just saw the news that in Swift 5, it will use UTF-8 for string. In the element docs, it says that Silver is using UTF-16 for string.

So, in the future, will Silver switch to UTF-8 for string? How does it affect Element?(for example, in the future, I want to use a .dll I compiled in Silver in version which using UTF-16)

Thanks.

Regards,
Xiaoguang

It won’t, as that’s an implementation detail of the Swift type. Elements uses the platformpnative string type on all platforms, because that gives the bets performance. Apple Swift strings have huge performance issues when musing Cocoa APIs; there was a session about this at WWDC last year — it’s scary!

If and when we provide interop with Apple Swift binaries (whenever they can get their Module Interface stability sorted out), this will be taken care of on our end.

—marc

1 Like