are you sure about this, also if the *W API forms are used, and a proper console font is selected?
The MSDN entries do sound a bit shoddy, like... WriteConsole being able to handle unicode text, but WriteConsole fails if the console handle is redirected. WriteFile can't write unicode chars to a console buffer, but
my guess is that it'll work fine if the standard input is redirected with piping (which is most likely the way the locate plugin works).
So... locate.exe would need to detect if the console handle is a console or redirected, use WriteConsoleW for console handles and WriteFile when redirected.EDIT:
when selecting Lucida Console (instead of a raster font), I was indeed able to get unicode output on a console under WinXP, using the following very quick-and-dirty app. The test was saved with notepad, using the "Unicode" encoding (and editing out the BOM marker). Notice the question marks at the top of the console; I tried the "unitest" application first with a raster font, then switched to lucida console and ran it again.
Apparently windows detects whether the current font supports unicode or not, and doesn't actually output in unicode if it doesn't?Locate32 Plugin for FARR by Okke
#define MAXSIZE 4096
FILE *f = fopen("c:\\test.unicode.txt", "rb");
DWORD numwritten = 0;
size_t num = fread(buf, 1, MAXSIZE-1, f);
buf[num] = 0;
WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), buf, num/2, &numwritten, 0);