public static Character escapeChar(char c) {
        switch(c) {
        case '\n':
        case '"':
        case '\'':
        case '\\':
            return c;
        case 'n':
            return '\n';
        case 't':
            return '\t';
        case 'r':
            return '\r';
        case '0':
            return '\0';
        default:
            return null;
        }
    }