Reputation: 694
I am processing Latex source.tex files with a Swift app. The source files contain German Umlaute. After adding the source files to a project and opening the files, the Umlaute are not displayed correctly. I am pretty sure it is an encoding problem. I wrote the following text to a Tex file, using TexShop V5.46:
Öse
Übel
Ärger
Dösen
Müde
Mängel
Schließlich
I saved the same content in three different files, which were encoded in UTF-8, ISO Latin 1 and Iso Latin 2.
I copied the files to a Swift project and opened the files. All of them displayed the same content:
÷se
‹bel
ƒrger
Dˆsen
M¸de
M‰ngel
Schliefllich
In the file Inspector I tried to change the Text encoding. However, there was no change at all.
By the way. Reading the file content to a String variable with the command:
let aString = try String(contentsOf: latexFileURL, encoding: .isoLatin2)
results in a valid input. Displaying the String with a SwiftUI TextView the Umlaute are displayed as expected.
Has anybody a solution, that the Umlaute are displayed properly in the Xcode text editor?
Upvotes: -1
Views: 48
Reputation: 694
I have got the solution:
Upvotes: 0