public static void isLegalNamespaceName(final byte[] namespaceName, final int start,
    final int end) {
    if (end - start < 1) {
      throw new IllegalArgumentException("Namespace name must not be empty");
    }
    String nsString = new String(namespaceName, start, (end - start), StandardCharsets.UTF_8);
    if (nsString.equals(DISALLOWED_TABLE_NAME)) {
      // Per https://zookeeper.apache.org/doc/r3.4.10/zookeeperProgrammers.html#ch_zkDataModel
      // A znode named "zookeeper" is disallowed by zookeeper.
      throw new IllegalArgumentException("Tables may not be named '" + DISALLOWED_TABLE_NAME + "'");
    }
    for (int i = 0; i < nsString.length(); i++) {
      // Treat the string as a char-array as some characters may be multi-byte
      char c = nsString.charAt(i);
      // ZooKeeper also has limitations, but Character.isAlphabetic omits those all
      // See https://zookeeper.apache.org/doc/r3.4.10/zookeeperProgrammers.html#ch_zkDataModel
      if (Character.isAlphabetic(c) || Character.isDigit(c) || c == '_') {
        continue;
      }
      throw new IllegalArgumentException(
        "Illegal character <" + c + "> at " + i + ". Namespaces may only contain "
          + "'alphanumeric characters' from any language and digits: " + nsString);
    }
  }
Valid namespace characters are alphabetic characters, numbers, and underscores.
hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java