Created
June 26, 2023 22:40
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
does it work on windows 11