Skip to content

Instantly share code, notes, and snippets.

@FlyTechVideos
Created June 26, 2023 22:40
Show Gist options
  • Save FlyTechVideos/ac708e977bd2aa73861b1936bf757255 to your computer and use it in GitHub Desktop.
Save FlyTechVideos/ac708e977bd2aa73861b1936bf757255 to your computer and use it in GitHub Desktop.
Calls IsTextUnicode from the WinAPI to figure out whether or not a text is recognized as Unicode. Meant for use in Windows XP.
#include "stdafx.h"
#include <windows.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "\r\n";
if (argc != 2) {
cout << " Usage: " << argv[0] << " \"Text to verify\"\r\n\r\n";
return 1;
}
char* string_to_check = argv[1];
char* result = IsTextUnicode(string_to_check, strlen(string_to_check), NULL) == 1 ? "YES" : "NO";
cout << " String: " << string_to_check << endl;
cout << " IsTextUnicode: " << result;
std::cout << "\r\n\r\n";
return 0;
}
@evanw-lgh
Copy link

does it work on windows 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment