UTF-8, Annotation Processor, Compiler source encoding on Windows

Answered

Setup

Windows 10

IntelliJ IDEA 2016.3.3
Build #IC-163.11103.6, built on January 16, 2017
JRE: 1.8.0_112-b15 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

Problem

  • Create simple Java project in IJ
  • Enable Annotation Processing
  • Have an annotation processor create some source file with UTF-8 encoded characters in it.
  • Get a lot of `Error:(line, row) java: illegal character: '\u201e'` messages...

Work-around

Force file encoding in `idea64.exe.vmoptions` via: `-Dfile.encoding=UTF-8`

Question

How do I convince IJ to handle generated source files as encoded with UTF-8 without setting the `file.encoding` vm option?

Issue

https://youtrack.jetbrains.com/issue/IDEA-167446

0
1 comment

Thanks for the report, please follow YT issue for updates.

0

Please sign in to leave a comment.