How to remove BOM (Byte-Order-Mark) from multiple UTF-8 files?

Asked

Viewed 94 times

2

I have several files in UTF-8 with BOM(Byte-Order-Mark) and I want to remove several at once. The need is that I have an Android project created in Eclipse and need to perform a migration to Android Studio. The IDE accuses these characters below in the classes:

 ï »¿

It is giving thousands of errors, because the project contains nothing less than basically 532 classes. To perform this procedure in Android Studio version 3, it is simple, but it is a very hard job, for having to do file by file. Just go on File > Remove BOM. See below:

inserir a descrição da imagem aqui

What would be the most practical way to solve this? How to remove the GOOD (Byte-Order-Mark) of multiple UTF-8 files?

  • I don’t know any way by android studio to solve this problem. But depending on the Operating System you are using, you can build a script that automates the process for all files in a folder.

  • I tested that project for Windows, but there is it for Mac and Linux. For me it worked perfectly. I put the program in the root folder where I wanted to remove all BOM’s and opened it. It runs the program to root folder and subfolders. If you’re going to use, don’t forget to back up your project first.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.