EXPORT TextKind __stdcall Text_GetKind(const char* text, int textLen) {
  bool utf8 = Text_HasUtf8Bom(text, textLen);
  if (utf8) {
    bool isAscii = Text_IsAscii(text + 3, textLen -3);
    if (isAscii)
      return AsciiWithUtf8Bom;
    else
      return Utf8WithBom;
  } else {
    bool isAscii = Text_IsAscii(text, textLen);
    if (isAscii)
      return Ascii;
    else
      return Unknown;
  }
}
EXPORT TextKind __stdcall Text_GetKind(const char* text, int textLen) {
  bool utf8 = Text_HasUtf8Bom(text, textLen);
  if (utf8) {
    ContentKindResult kind = Text_ContentKind(text + 3, textLen -3);
    if (kind == ResultAscii)
      return TextKind_AsciiWithUtf8Bom;
    else if (kind == ResultUtf8)
      return TextKind_Utf8WithBom;
    else 
      return TextKind_ProbablyBinary;
  } else {
    ContentKindResult kind = Text_ContentKind(text, textLen);
    if (kind == ResultAscii)
      return TextKind_Ascii;
    else if (kind == ResultUtf8)
      return TextKind_Utf8;
    else 
      return TextKind_ProbablyBinary;
  }
}