Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8134455

Clean out non-ASCII characters from source code

XMLWordPrintable

      Some source files contains UTF-8 characters but is not saved with Byte Order Mark(BOM), those file cause compile warnings on Traditional Chinese Windows 8, even though the locale is UTF-8 under cygwin.

      $ locale
      LANG=zh_TW.UTF-8
      LC_CTYPE="zh_TW.UTF-8"
      LC_NUMERIC="zh_TW.UTF-8"
      LC_TIME="zh_TW.UTF-8"
      LC_COLLATE="zh_TW.UTF-8"
      LC_MONETARY="zh_TW.UTF-8"
      LC_MESSAGES="zh_TW.UTF-8"
      LC_ALL=

      Typical warning is as follows, and because build system consider warning as errors, this cause the build to fail.

      c:/ws/8027634/jdk/src/java.desktop/share/native/liblcms/cmscgats.c : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
      Awt2dLibraries.gmk:406: recipe for target '/cygdrive/c/ws/8027634/build/rel/support/native/java.desktop/liblcms/cmscgats.obj' failed
      make[3]: *** [/cygdrive/c/ws/8027634/build/rel/support/native/java.desktop/liblcms/cmscgats.obj] Error 2


      There are three possible solutions,
      a. Change the UTF-8 characters with ASCII characters.
      b. Save the source file with BOM.
      c. Change build setup to ignore such warning, C4819.


      My recommendation is to use ASCII characters whenever possible. If non-ASCII character is necessary, save with BOM.

            Unassigned Unassigned
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: