  bool equals(const StringView &other) const {
    if (other.isASCII()) {
      return equals(ASCIIRef(other.castToCharPtr(), other.length()));
    }
    return equals(UTF16Ref(other.castToChar16Ptr(), other.length()));
  }
  bool equals(const StringView &other) const {
    if (other.isASCII()) {
      return equals(ASCIIRef(other.castToCharPtr(), other.length()));
    }
    return equals(UTF16Ref(other.castToChar16Ptr(), other.length()));
  }