#include #include int compareStringsIgnoreCase(const wchar_t* str1, const wchar_t* str2) { // 正規化した文字列を格納するためのバッファ wchar_t normalizedStr1[256]; wchar_t normalizedStr2[256]; // 文字列を正規化 int len1 = FoldString(MAP_FOLDDIGITS | MAP_FOLDCZONE, str1, -1, normalizedStr1, sizeof(normalizedStr1) / sizeof(normalizedStr1[0])); int len2 = FoldString(MAP_FOLDDIGITS | MAP_FOLDCZONE, str2, -1, normalizedStr2, sizeof(normalizedStr2) / sizeof(normalizedStr2[0])); // 文字列を比較 int result = _wcsicmp(normalizedStr1, normalizedStr2); return result; } int main() { const wchar_t* string1 = L"Hello World"; const wchar_t* string2 = L"hello world"; // 文字列を比較 int result = compareStringsIgnoreCase(string1, string2); if (result == 0) { wprintf(L"The strings are equal.\n"); } else if (result < 0) { wprintf(L"String 1 is less than String 2.\n"); } else { wprintf(L"String 1 is greater than String 2.\n"); } return 0; }