public static String charsToEscapes(String str, boolean history)
public static String charsToEscapes(String str)
	public static String charsToEscapes(String str, boolean history)	{		StringBuffer buf = new StringBuffer();		for(int i = 0; i < str.length(); i++)		{			char c = str.charAt(i);			switch(c)			{			case '\n':				buf.append("\\n");				break;			case '\t':				buf.append("\\t");				break;			case '[':				if(history)					buf.append("\\[");				else					buf.append(c);				break;			case ']':				if(history)					buf.append("\\]");				else					buf.append(c);				break;			case '"':				if(history)					buf.append(c);				else					buf.append("\\\"");				break;			case '\'':				if(history)					buf.append(c);				else					buf.append("\\\'");				break;			case '\\':				buf.append("\\\\");				break;			default:				buf.append(c);				break;			}		}		return buf.toString();	} //}}}