RFR: 8301854: C4819 warnings were reported in libfreetype on Windows
Magnus Ihse Bursie
ihse at openjdk.org
Mon Feb 6 13:51:49 UTC 2023
On Mon, 6 Feb 2023 12:34:36 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
> This is subtask of https://github.com/openjdk/jdk/pull/12427 .
>
> I have seen C4819 warning in libfreetype files on Windows (CP932: Japanese locale)
>
>
> d:\github-forked\jdk\src\java.desktop\share\native\libfreetype\src\autofit\afscript.h(1): warning C4819: ファイルは、現在のコード ページ (932) で表示できない文字を含んでいます。データの損失を防ぐために、ファイルを Unicode 形式で保存してください。
>
>
> I added C4819 to DISABLED_WARNINGS_microsoft for libfontmanager and for libfreetype because they are 3rd-party libraries.
So to add some context to this and the related PRs. **C4819** has this official description:
`The file contains a character that cannot be represented in the current code page (number). Save the file in Unicode format to prevent data loss.`
So, this is not so much a compilation error per se, but a problem with the encoding of our source code files.
Some time ago, there were a discussion that we should make sure our code base where in utf-8, instead of the current unspecified state of "mostly ascii, but some additional characters but we won't tell you which encoding, hopefully it's latin-1".
I'm thinking the correct choice is maybe not to silence the warning, but to actually put down our collective feet, say "enough is enough of this nonsense!", declare the source to be utf-8, turn on all flags needed to get our tools to recognize this fact, and then go on with our lives.
-------------
PR: https://git.openjdk.org/jdk/pull/12436
More information about the build-dev
mailing list