com.pdfunit.tools

## Class ConvertUnicodeToHex

- java.lang.Object
- - com.pdfunit.tools.UtilityBase
  - - com.pdfunit.tools.ConvertUnicodeToHex

-     @DoNotObfuscate
      public class ConvertUnicodeToHex
      extends UtilityBase

  This utility reads any string and converts the non-ASCII characters into their corresponding Unicode hex-code ("€" for the Euro character).

  The input file can be of any encoding, but you have to set the right encoding! For example, when the input file is of "UTF-8", you can use before executing this program from command-line:

  `set _JAVA_OPTIONS=-Dfile.encoding=UTF-8`

  The input string will be trimmed! When leading or trailing space are necessary, you have to add them later by hand.

  The output file is written in the default encoding of the Java runtime.

  The filename is derived from the input file automatically.

  When you start the program without parameters, a message will show you the commandline parameters.

  Since:
    2016.05
  Author:
    Carsten Siedentop, April 2016

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.tools.UtilityBase

      `EMPTY_STRING, OUTPUT_PATH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConvertUnicodeToHex(java.lang.String[] args)` Converts Unicode string with the non-ASCII characters into their corresponding Unicode hex-code ("€" for the Euro character).

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkArguments(java.lang.String[] args)`
    `static void` | `main(java.lang.String[] args)` Converts Unicode string with the non-ASCII characters into their corresponding Unicode hex-code ("€" for the Euro character).
    `protected void` | `parseArguments(java.lang.String[] args)`

    - ### Methods inherited from class com.pdfunit.tools.UtilityBase

      `appendTrailingSlash, assertIsDirectory, checkArguments, createSourceBaseName, createUTF8Writer, isDirectory, showUsage, writeToFile`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConvertUnicodeToHex

          public ConvertUnicodeToHex(java.lang.String[] args)
                              throws java.lang.Exception

      Converts Unicode string with the non-ASCII characters into their corresponding Unicode hex-code ("€" for the Euro character).
      Parameters:
        `args` - args[0] input-file, args[1] destination-directory, args[2] password
      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      Converts Unicode string with the non-ASCII characters into their corresponding Unicode hex-code ("€" for the Euro character).

      The program does not use static fields, so you can invoke main() multiple times from a batch (unit tests).

      Parameters:
        `args` - args[0] input-file, args[1] destination-directory, args[2] password
      Throws:
        `java.lang.Exception`

    - #### checkArguments

          protected void checkArguments(java.lang.String[] args)
                                 throws PDFUnitInvalidProgramInvokeException

      Specified by:
        `checkArguments` in class `UtilityBase`
      Throws:
        `PDFUnitInvalidProgramInvokeException`

    - #### parseArguments

          protected void parseArguments(java.lang.String[] args)
                                 throws PDFUnitInvalidProgramInvokeException

      Specified by:
        `parseArguments` in class `UtilityBase`
      Throws:
        `PDFUnitInvalidProgramInvokeException`

Copyright (C) PDFUnit.com. See here for license.