private static boolean safeToUnquote(String qs) {
        int upperCount=0, lowerCount=0, idCount=0;

        for (int i=1; i < qs.length()-1; i++) {
            char c = qs.charAt(i);
            if (Character.isUnicodeIdentifierPart(c))
                ++idCount;
            if (Character.isUpperCase(c))
                ++upperCount;
            else if (Character.isLowerCase(c))
                ++lowerCount;
        }
        return (qs.length()-2 > 0
                && (qs.length()-2 == idCount
                && (upperCount == 0 || lowerCount == 0)));
    }