Paste (Command-v) inserts BOM character into beginning of every inserted string
Every time I copy and paste from the clipboard using Command-C, Command-V in Mac OS X, the first line is prefixed with the BOM. This is causing my Groovy and Java builds to fail. I first noticed this with IntelliJ IDEA 2016.3.2 (Build #IU-163.10154.41) on Mac OS X (Sierra 10.12.2).
The Idea Editor shows the copied character as a space with some error and if you hover over it says that it is an "illegal character: U+FEFF" - which is good, o.w. it may have taken a lot longer to figure out what was going on! I can just go delete them, but I fear I am going to forget one and it is going to be left in a file without notice for a while.
Confirmed that my .idea/encodings.xml file says UTF-8. So no issue there.
Also, after updating IntelliJ IDEA to 2016.3.3 Build #IU-163.11103.6, the problem persists.
I had originally posted on a thread that seems related to this BOM issue on the thread below but erased it since this seems like a general Editor issue:
Please sign in to leave a comment.
Where do you copy from? Does it happen if you copy from one file inside IDEA and paste into another file?
Does it affect all the file types?
Happens regardless of where I paste from. I can copy a paste from within the same file or try copying something from an external editor (MacVim, Notepad, etc.).
I believe it is happening for all file types. At least I can reproduce it in an ANTLR .g4, a Java and Groovy file.
Please file a bug at https://youtrack.jetbrains.com/issues/IDEA with the logs folder attached (https://intellij-support.jetbrains.com/hc/articles/207241085) and a sample project (if the issue is not reproducible in a new project). Since the forum doesn't allow file attaches, it would be a more convenient way to proceed with this issue.
Also check if you can reproduce this problem on any other machine, I don't recall any other reports about this problem recently, so it could be specific to your system somehow.
Ok, thank you. Created example project and confirmed it happens even in a simple Hello World app from IntelliJ's template projects. Issue # 166868. I don't have access to another computer to check whether this is an issue elsewhere - sorry about that.
https://youtrack.jetbrains.com/issue/IDEA-166868