Hello, all. I've been experimenting in porting a GNU project to Windows while preserving Unicode capability. Prepending _t everywhere like Microsoft suggest is hardly an option due to change of code it requires and subtle problems with it. E.g. consider code:
s = malloc (strlen (a) + strlen (b) + 3); p = stpcpy (s, a); *p++ = '/'; p = stpcpy (s, b); *p = '\0' If you just replace char with _tchar missing sizeof (char) multiplier in malloc will make your program crash. So I went another way: keeping the code as-is but adding following translators: around main to have unicode argv around all fs functions receiving filename as argument around console and file functions doing conversion if std* point to console. My next problem is that gettext assumes that on windows program wants ANSI windows codepage and never gives utf8. There seems to be no way to override this. Would be an option to accept the patches to do the wrapping as described and have a way to override gettext charset by calling a special function e.g. gettext_set_charset ("utf-8") or gettext_force_utf8 ();
signature.asc
Description: OpenPGP digital signature