Java Tools Tutorials - Herong's Tutorial Notes - Version 5.30, by Dr. Herong Yang

'native2ascii' - Encoding Converter Command and Options

This section describes the native-to-ASCII encoding converter 'native2ascii' and its options. Non-ASCII characters in a Java source file must be converted into \udddd Unicode sequences before giving it to the Java compiler.

"native2ascii": A command line tool that reads a text file stored in a non-ASCII encoding and converts it to an ASCII text file. All non-ASCII characters will be converted into \udddd sequences, where dddd is the Unicode code value of the non-ASCII character.

"native2ascii" is an important Java tool, because Java compiler and other Java tools can only process files which contain ASCII characters and \udddd Unicode code sequences. If you have any non-ASCII character strings written in a native encoding included in your Java source code, you need to run this "native2ascii" tool to convert your Java source code.

"native2ascii" has the following command syntax:

native2ascii [options] inputfile outputfile

where "options" is a list of these options:

  • "-encoding encoding_name" - Specify the encoding name which is used by the conversion procedure. The "encoding_name" string must be one of those supported encodings in the Supported Encodings document. "encoding_name" example: utf-8.
  • "-reverse" - Perform the reverse operation: convert a file with \udddd Unicode code sequences to one with native-encoded characters.

Table of Contents

 About This Book

 Java Tools Terminology

 Installing Java 8 on Windows

 'javac' - The Java Program Compiler

 'java' - The Java Program Launcher

 'jdb' - The Java Debugger

 'jconsole' - Java Monitoring and Management Console

 'jstat' - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jvisualvm (Java VisualVM) - JVM Visual Tool

 'jar' - The JAR File Tool

 'javap' - The Java Class File Disassembler

 'keytool' - Public Key Certificate Tool

'native2ascii' - Native-to-ASCII Encoding Converter

'native2ascii' - Encoding Converter Command and Options

 'javac' Using CP1252 to Process Source File

 UTF-8 to \udddd Conversion with 'native2ascii -encoding'

 Setting UTF-8 Encoding in PrintStream

 Converting \udddd Sequences Back with "-reverse" Option

 Outdated Tutorials

 References

 PDF Printing Version

'native2ascii' - Encoding Converter Command and Options - Updated in 2014, by Dr. Herong Yang