From 3aa2ea7e67c879dafa0f967073c2d8b98d62c996 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 9 May 2025 09:05:10 +0000 Subject: [PATCH] 8301971: Make JDK source code UTF-8 8338973: Document need to have UTF-8 locale available to build the JDK Reviewed-by: erikj, naoto, mbaesken --- .editorconfig | 3 + .gitattributes | 1 + doc/building.html | 8 ++ doc/building.md | 5 + make/Docs.gmk | 4 +- make/autoconf/basic.m4 | 24 ++++- make/autoconf/configure | 4 +- make/autoconf/flags-cflags.m4 | 16 ++- make/common/JavaCompilation.gmk | 19 ++-- make/common/JdkNativeCompilation.gmk | 2 + make/common/support/unicode2x.sed | 100 ------------------ .../unix/native/libjava/locale_str.h | 6 +- .../libjava/HostLocaleProviderAdapter_md.c | 8 +- 13 files changed, 72 insertions(+), 128 deletions(-) delete mode 100644 make/common/support/unicode2x.sed diff --git a/.editorconfig b/.editorconfig index 98f07b3c5fb..8cf0bd8d62a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,8 @@ root = true +[*] +charset = utf-8 + [*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}] trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes index ebb586628c3..5a18aa21d98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * -text +* encoding=utf-8 *.java diff=java *.c diff=cpp *.h diff=cpp diff --git a/doc/building.html b/doc/building.html index b5d39a68ea8..fde6cde4c32 100644 --- a/doc/building.html +++ b/doc/building.html @@ -305,6 +305,14 @@ using
  • If using Cygwin, you must make sure the file permissions and attributes between Windows and Cygwin are consistent. It is recommended that you follow this procedure:

    +
  • UTF-8 support is needed to compile the JDK. On Unix systems, this +typically means that the C.UTF-8 or +en_US.UTF-8 locale needs to be available. For Windows +users, please see the section on Locale +Requirements below.

  • +
  • On Windows, if using Cygwin, extra care +must be taken to make sure the environment is consistent. It is +recommended that you follow this procedure: