Error: the solution to the illegal character ‘\ ufeff’

An error occurred while compiling the Scala file with scalac today, with the following error message:

There are many explanations on the Internet about the cause of the error, so I won’t repeat it here, but directly say the solution:
Using Notepad++ or similar software, convert to utf-8 bon-free coding format.

Scalac Helloworld.Scala again, OK.

Of course, the Java language has the same solution.

Read More: