
On Fri, May 20, 2005 at 07:43:31PM +0000, Neil Mitchell wrote:
I debated over this with a friend, and we couldn't find a cleaner place to put the console intercepts. Before unicode happened intercepting fgetc worked. Now, with unicode defined, fgetc_mb is used - which is a defined function, not a library call. Since Wintext.h is imported *before* char.h, its then impossible to redefine fgetc_mb as something else (because the prototype and the declaration both use fgetc_mb, so would be redefined anyway, and defeat the purpose). Because of this the redefine's must occur after char.h is imported - and the cleanest place to ensure this is at the bottom of char.h. [...] As to how the WinHugs console emulator works with unicode, I have no idea. I wouldn't even like to take a guess. My first task is going to be to simplify, reduce and refactor the WinHugs code. After that, I'll take a look at the console and see if a replacement using Windows Rich Text control would work (which gives Unicode and lots of other nice features for free), or if the console can be extended to unicode (should be relatively easy).
So should it be enough to just turn off CHAR_ENCODING for WinHugs until you're ready to do Unicode handling properly? Hmm, I don't see how it got turned on: winhugs/options.h doesn't mention it.