While prototyping some solutions I found a bug in GetStrCodePages, it doesn't return when a character with different codepage appears in the string, it only continues assuming that character has the same codepage as the rest of the string.
For example: `Abc\u307b`, in windows you would require two calls for processing the entire string, the first call would return the codepage for the first three characters and in the second one the last character. In Wine it processes the 4 characters and returns as if it had processed 4 characters, when it should return 3.