[Xvid-devel] Patch for XVID MPEG-4 DirectShow/MediaFoundation filter

Jerker Bäck jerker.back at gmail.com
Mon Jun 13 23:03:10 CEST 2011


Hi Matias,

> Still, making the xvidcore both utf-16 utf-8 and ansi compatible is a good
> thing.
Yes couldn't agree more, this was my intention and the real benefit with
this patch. And - I've got no real problem with the tchar.h _T() macro
solution - works for me. AFAIK works for mingw also.

More reflections:
People with no Windows development experience usually misunderstands the
UNICODE macro issue and think it's about international character translation
and locale settings. They usually sigh and starts to talk about UTF8 as an
alternative to UTF16 and mean this is superior in performance. Well, it's
not about that. Instead the UNICODE macro is (was) an OS specific technical
solution to allow transparent code shift from ANSI-based 16-bit Windows to
Unicode (UTF16) based 32-bit Windows NT. Binary compiles without the UNICODE
define uses the ANSI (A) compatibility layer Win32 functions and would work
also on 16-bit Windows machines. On NT machines almost all the A functions
translates into their W counterpart internally via an UTF16 character
conversion (e.g. OutputDebugString() is an exception). The W (wide) version
Win32 functions are also usually more powerful with larger buffers etc. So,
it's usually true to say that the W version functions are faster and more
efficient. In modern Win32 code the UNICODE define is standard.

ANSI is nearly identical with ISO-8859-1, UTF8 is not used at all. In fact,
I think dealing with UTF8 strings would be the least efficient in Windows
(and not convenient as in BSD and Linux).

Regards
Jerker



More information about the Xvid-devel mailing list