public static void escapeJavaScript(final Reader reader, final Writer writer)
            throws IOException {
        escapeJavaScript(reader, writer,
                JavaScriptEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_XHEXA_AND_UHEXA,
                JavaScriptEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
    }
public static void escapeJavaScript ( final Reader reader , final Writer writer ) throws IOException { escapeJavaScript ( reader , writer , JavaScriptEscapeType . SINGLE_ESCAPE_CHARS_DEFAULT_TO_XHEXA_AND_UHEXA , JavaScriptEscapeLevel . LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET ) ; }
<p>
Perform a JavaScript level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The JavaScript basic escape set:
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>&#92;0</tt> (<tt>U+0000</tt>),
<tt>&#92;b</tt> (<tt>U+0008</tt>),
<tt>&#92;t</tt> (<tt>U+0009</tt>),
<tt>&#92;n</tt> (<tt>U+000A</tt>),
<tt>&#92;v</tt> (<tt>U+000B</tt>),
<tt>&#92;f</tt> (<tt>U+000C</tt>),
<tt>&#92;r</tt> (<tt>U+000D</tt>),
<tt>&#92;&quot;</tt> (<tt>U+0022</tt>),
<tt>&#92;&#39;</tt> (<tt>U+0027</tt>),
<tt>&#92;&#92;</tt> (<tt>U+005C</tt>) and
<tt>&#92;&#47;</tt> (<tt>U+002F</tt>).
Note that <tt>&#92;&#47;</tt> is optional, and will only be used when the <tt>&#47;</tt>
symbol appears after <tt>&lt;</tt>, as in <tt>&lt;&#47;</tt>. This is to avoid accidentally
closing <tt>&lt;script&gt;</tt> tags in HTML. Also, note that <tt>&#92;v</tt>
(<tt>U+000B</tt>) is actually included as a Single Escape
Character in the JavaScript (ECMAScript) specification, but will not be used as it
is not supported by Microsoft Internet Explorer versions &lt; 9.
</li>
<li>
Two ranges of non-displayable, control characters (some of which are already part of the
<em>single escape characters</em> list): <tt>U+0001</tt> to <tt>U+001F</tt> and
<tt>U+007F</tt> to <tt>U+009F</tt>.
</li>
</ul>
</li>
<li>All non ASCII characters.</li>
</ul>
<p>
This escape will be performed by using the Single Escape Chars whenever possible. For escaped
characters that do not have an associated SEC, default to using <tt>&#92;xFF</tt> Hexadecimal Escapes
if possible (characters &lt;= <tt>U+00FF</tt>), then default to <tt>&#92;uFFFF</tt>
Hexadecimal Escapes. This type of escape <u>produces the smallest escaped string possible</u>.
</p>
<p>
This method calls {@link #escapeJavaScript(Reader, Writer, JavaScriptEscapeType, JavaScriptEscapeLevel)}
with the following preconfigured values:
</p>
<ul>
<li><tt>type</tt>:
{@link org.unbescape.javascript.JavaScriptEscapeType#SINGLE_ESCAPE_CHARS_DEFAULT_TO_XHEXA_AND_UHEXA}</li>
<li><tt>level</tt>:
{@link org.unbescape.javascript.JavaScriptEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET}</li>
</ul>
<p>
This method is <strong>thread-safe</strong>.
</p>

@param reader the <tt>Reader</tt> reading the text to be escaped.
@param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will
be written at all to this writer if input is <tt>null</tt>.
@throws IOException if an input/output exception occurs

@since 1.1.2