When I copy paste code into Android Studio sometimes (from WEB or other external source) I get some unvisible characters and I can't compile. Is there a way to avoid this? Reformat code automatically? Plugin? Change settings?
Error:(40, 61) error: illegal character: \8232
So far I delete the code any type it in by hand again.
The “illegal character” error occurs in the compilation phase, so it's quite easy to detect. The next example shows us how it works. Ideally, to fix this problem, the only thing to do is save the file as UTF-8 without BOM encoding. After that, the problem is solved.
The JavaScript exception "illegal character" occurs when there is an invalid or unexpected token that doesn't belong at this position in the code.
There's "Messages" tab in Android Studio. Complilation errors and warning go there. You can select it by pressing alt+0 (⌘+0 in OS X - a shortcut to View|Tool Windows|Messages).
I believe your file encoding is windows-1252 (bottom right corner in AS)? Here is a Blog about file encoding. I also use UTF-8 for everything. Blog about file encodings in IntelliJ
Since AS is IntelliJ-based, this also applies to AS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With