JDK-6568430 : native2ascii should print error messages to stderr
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86
  • Submitted: 2007-06-11
  • Updated: 2017-02-24
  • Resolved: 2017-02-24
Related Reports
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
The native2ascii tool seems to print error messages to the standard output stream and not the standard error stream.



JUSTIFICATION :
If native2ascii's standard output stream has been redirected to a file or another process and an error occurs the user won't know it; this is a usability issue. The user won't know that something has gone wrong until he/she tries to do something with the output file.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The desired behaviour is that error messages are printed to the standard error stream. This way  error messages are not hidden from the user.
ACTUAL -
For example, if the file Test.txt doesn't exist, the command

$ native2ascii Test.txt > Test.properties

writes the error message "java.lang.Exception: Test.txt could not be read" to the file Test.properties and the user won't know that an error has occured. The same thing happens if an unsupported encoding has been used.

CUSTOMER SUBMITTED WORKAROUND :
Don't use shell redirection with native2ascii.

Comments
native2ascii removed in JDK 9.
24-02-2017