Example #1
0
  static {
    String strCharset = System.getProperty("file.encoding");
    if (strCharset == null || strCharset.equalsIgnoreCase("MacRoman")) strCharset = "cp1252";

    if (strCharset.equalsIgnoreCase("utf-8")) charset = CharsetUtil.UTF8;
    else if (strCharset.equalsIgnoreCase("iso-8859-1")) charset = CharsetUtil.ISO88591;
    else charset = CharsetUtil.toCharset(strCharset, null);

    // Perm Gen
    permGenSpaceBean = getPermGenSpaceBean();
    // make sure the JVM does not always a new bean
    MemoryPoolMXBean tmp = getPermGenSpaceBean();
    if (tmp != permGenSpaceBean) permGenSpaceBean = null;
  }
Example #2
0
 public static void setCharset(String charset) {
   SystemUtil.charset = CharsetUtil.toCharset(charset);
 }