Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10, could not decode input file using specific encoding

I am working on an iOS app. It is working fine in Xcode 9.4.1, but when I build it in Xcode 10 it gives me following error:

Error

I tried the solution given in the following post by changing the encoding, but it didn't work. I tried it by both Reinterpret and Convert

enter image description here

still the same error:

enter image description here

It's working fine on Xcode 9.4.1

like image 544
Akshay Sunderwani Avatar asked Sep 19 '18 18:09

Akshay Sunderwani


3 Answers

Find your Localizable.strings in a Terminal and execute:

$ iconv -f UTF-16LE -t UTF-8 Localizable.strings >  LocalizableNew.strings

Then check LocalizableNews.string and if there is no errors just replace files

$ mv LocalizableNew.strings Localizable.strings
like image 127
Eva Madrazo Avatar answered Oct 21 '22 14:10

Eva Madrazo


I have similar error once i open my project in Xcode 10.4 and open it agian in Xcode 10.1.

I solved it by selecting my all Localizable.strings file and change there text encoding to UTF-16(In my case error was related to UTF-16 you can change it to UTF-8)

So changing the text encoding to UTF-16 or UTF-8 will works.

enter image description here enter image description here

like image 38
guru Avatar answered Oct 21 '22 16:10

guru


It sounds like the file is corrupted, probably with parts of it encoded in UTF-8 and parts of it encoded in 8859-5. From its name, I would suspect this is a Cyrillic localization (perhaps Russian), and the file was probably edited using an editor that didn't correctly maintain encoding or use UTF-8 (the most common cause of that is editing on Windows).

You'll need to open the file, probably in an external editor that can handle random encodings like vim or Sublime Text, and fix any corruption. Exactly how to do that depends on the nature of the corruption.

like image 24
Rob Napier Avatar answered Oct 21 '22 16:10

Rob Napier