Hello and thank you for reading my post.
My problem is the following: I want to compile a Java source file with \"javac\" with this file being UTF-8 encoded with a BOM (
https://stackoverflow.com/a/28043356/7050261
Actually, using the BOM in UTF-8 files IS useful to distinguish an ANSI-coded file from an Unicode-coded file.
Actually
BOM is not about distinguishing ANSI and Unicode. Do not use a feature on purpose it is not designed for.
UTF-8 was designed to be backward-compatible with ANSI intentionally, so a lot of code written to process formatted text relied on 0..127 bytes only (XML, JSON, etc.) should work correctly with UTF-8 encoded text without any modifications.