RamonUnch / GreenPad

Fork from roytam1 fork from original GreenPad
21 stars 0 forks source link

Fix detection of cp_acp compatible string #163

Closed RamonUnch closed 9 months ago

RamonUnch commented 9 months ago

Add the isCompatibleWithACP() function in the String class. To do this we need to convert from Unicode to local CP_ACP and then back to Unicode to finally compare the original string with the final string and if they are equal then we can be sure.

The reason we need to do that is because WC2MB silently converts some latin characters to their undecorated equivalent. This induce losses.

eg: if you use CP1252 the character ħ gets converted to h without warning. On Windows 2000+ we could use the WC_NO_BEST_FIT_CHARS flag..