Error: illegal Character ' ufeff' - encoding "UTF-8 without BOM"

Asked

Viewed 1,246 times

0

I’m in the process of migrating from an Android project created in Eclipse to Androidstudio. When trying to compile after migrating, the following error appears:

Error:(1, 10) error: class, interface, or enum expected Error:(1, 1)
error: illegal character: '\ufeff'

I went "sapead" on the internet and found that this is a problem related to the BOM character (Byte Order Mark). This answer gives a solution that edit the file in Noteped++ and save the file with encoding "UTF-8 without BOM", however the project has around 500 files.

Is there any other way to solve the problem? If not, what would be best way to change and save multiple files (around 500) "NO GOOD" at the same time?

1 answer

0

Try to take a replace on all the files at once by android studio same.

Search for ufeff and leave replace blank

Menu Edit >> Find >> Replace in Path

inserir a descrição da imagem aqui

--- Edit

I think maybe less work, intellij Ultimate has the print option below, maybe it’s worth you download a trial and try

inserir a descrição da imagem aqui

  • It didn’t work because you can’t find this string ' ufeff'

  • What, see my updated reply, it might be easier to download intellij than edit your 500 files

Browser other questions tagged

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