I am able to compile in Swift a very simple source file encoded in UTF-8 (with or without BOM).
But when I try to build the same source file but now encoded in UTF-16, I get an error : "Invalid Swift parseable output (malformed JSON)".
The file (main.swift) :
import Foundation let str : String = "abc" print (str)
What is happening ? What JSON is malformed?
Note that I can see the UTF-16 file in the code editor, I can edit it, but I cannot build it.
In Xcode > Preferences > Text Editing, I set "Default Text Encoding" to UTF-16BE/LE but to no avail.
Any help is appreciated, does Swift support only UTF-8 source files?