JDK-6964680 : build fails if a timezone data file contains non-ASCII-7 chars and LANG is not "C"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2010-06-28
  • Updated: 2011-01-19
  • Resolved: 2010-12-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Relates :  
Description
Our source licensee reports that a jdk build of 1.4.2 fails (namely building j2se/make/sun/javazic) if a timezone file is in incorrect utf-8 encoding.

For example
/java/re/j2se/1.4.2_22/promoted/ea/b01/j4b/ws//j2se/make/sun/javazic/tzdata/southamerica

Correctness may be verified with GNU's iconv tool
 iconv -f utf-8 -t ascii < /Volumes/java/re/j2se/1.4.2_22/promoted/ea/b01/j4b/ws//j2se/make/sun/javazic/tzdata/southamerica > /dev/null

iconv: (stdin):369:71: cannot convert

According to the analysis done by the CU the problem happens when building j2se/make/sun/javazic

It will first compile the Zoneinfo compiler (in sun.tools.javazic.Zoneinfo) which in turn is used to compile the Zeneinfo-files from "j2se/make/sun/javazic/tzdata/".
The problem now is that the Zoneinfo class uses a FileReader for reading the timezone files and FileReader assumes the "default character encoding". If this "default character encoding" happens to be "utf8" the reader will eventually throw a sun.io.MalFormedInputException if reading the mentioned file (see mail below). Subsequently this will abort Zoneinfo with an "IO error: " message (see sources of Zoeninfo.java)

It is suggested to either convert timezone files to proper ASCII-7 or UTF-8 encoding or to make corresponding changes in Zoneinfo around the FileReader.
Another suggestion is to specify in build instructions that user should set LANG env variable to en_US.ISO-8859-1

Alternatively a standard FileReader in Zoneinfo.java could be replaced with InputStreamReader(new FileInputStream(fname),"ASCII ") so that this part of code does not rely on locale settings butrather on actual input data file encoding (timezone file).

Comments
EVALUATION This one is not reproducible in JDK 7.
20-12-2010