Discussion: Windows ANSI API (A) used in OF instead of Unicode (W)

Some discussion on why this is needed in OF. Why are the ANSI methods used in oF rather than the Unicode ones?

For Windows code using the ANSI API is not recommended. It seems to be inefficient and it’s recommended for old versions of Windows only.

I’m guessing oF being multiplatform is the cause. But I’d like to have more insight on this.

yes it’s mostly a multiplatform thing, working with utf8 is what every platform does today except for windows. there’s a compiler setting to use multicharacter encoding which if i’m not mistaken means utf8 so then when you call the version without A or W it works for normal strings.

in any case it’s better to loose some performance in string operations which usually are not a bottleneck in OF applications that force everyone using windows to use for example wstring instead of plain string

1 Like