code: public static byte[] quote(byte[] term) {
          boolean needsQuote = false;
  
          for (int i = 0; i < term.length; i++) {
              if (!Authorizations.isValidAuthChar(term[i])) {
                  needsQuote = true;
                  break;
              }
          }
  
          if (!needsQuote) {
              return term;
          }
  
          return VisibilityEvaluator.escape(term, true);
      }
docs: Properly quotes terms in a column visibility expression. If no quoting is needed, then nothing is done.
  
  @param term term to quote, encoded as UTF-8 bytes
  @return quoted term (unquoted if unnecessary), encoded as UTF-8 bytes
  @see #quote(String)