Code: Select all
Import "MSVCRT.LIB"
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
setlocale_(Category, Locale.p-ascii) As "_setlocale"
stricmp_(*String1, *String2) As "__stricmp"
wcsicmp_(*String1, *String2) As "__wcsicmp"
mbsicmp_(*String1, *String2) As "__mbsicmp"
CompilerElse
setlocale_(Category, Locale.p-ascii) As "setlocale"
stricmp_(*String1, *String2) As "_stricmp"
wcsicmp_(*String1, *String2) As "_wcsicmp"
mbsicmp_(*String1, *String2) As "_mbsicmp"
CompilerEndIf
EndImport
*Ascii1 = AllocateMemory(10)
PokeS(*Ascii1, "Ä", -1, #PB_Ascii)
*Ascii2 = AllocateMemory(10)
PokeS(*Ascii2, "ä", -1, #PB_Ascii)
*Unicode1 = AllocateMemory(10)
PokeS(*Unicode1, "Ä", -1, #PB_Unicode)
*Unicode2 = AllocateMemory(10)
PokeS(*Unicode2, "ä", -1, #PB_Unicode)
*UTF81 = AllocateMemory(10)
PokeS(*UTF81, "Ä", -1, #PB_UTF8)
*UTF82 = AllocateMemory(10)
PokeS(*UTF82, "ä", -1, #PB_UTF8)
setlocale_(0, "")
Debug stricmp_(*Ascii1, *Ascii2); = 0 (equal)
Debug wcsicmp_(*Unicode1, *Unicode2); = 0 (equal)
Debug mbsicmp_(*UTF81, *UTF82); <> 0 (not equal) why?
nco2k