Class UnicodeConverter


  • public class UnicodeConverter
    extends java.lang.Object
    Class UnicodeConverter contains some static methods to convert unicode chars into their escape sequence form (provided by James Huang from the JavaCC mailing list).

    Class is thread-safe.

    TESTCASE some to add
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String addUnicodeEscapes​(java.lang.String str)
      Converts a string by replacing non ASCII characters with their Unicode representation.
      ASCII characters are between 0x20 and 0x7e included, or tab, new line, carriage return? form feed and backspace.
      Should be the same as (the commented) #convertString(String) but comes from JavaCC.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addUnicodeEscapes

        public static java.lang.String addUnicodeEscapes​(java.lang.String str)
        Converts a string by replacing non ASCII characters with their Unicode representation.
        ASCII characters are between 0x20 and 0x7e included, or tab, new line, carriage return? form feed and backspace.
        Should be the same as (the commented) #convertString(String) but comes from JavaCC. CODEJAVA ?
        Parameters:
        str - - a string
        Returns:
        the converted string