ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

Locate32 Plugin for FARR by Okke

<< < (19/25) > >>

Armando:
So you think that characters like "_" or "+" affect the search because of incomplete Unicode compatibility ?

jmj:
f0dder:
OK, so everything I know at the moment:
1. Console in Windows XP can produce full Unicode output but only for displaying. Piping and redirecting is unsupported so it's useless for us.
2. Standard printing functions like wprintf (used in locate.exe) uses built-in WideCharToMultibyte conversion (to DOS codepage in my case), so polish letters have wrong hexcodes in normal windows.
3. I'm able to write raw Unicode to console (swprintf+WriteFile, without widechar->codepage conversion) - when displaying it look like there are spaces between all letters, but after redirecting to a file it works like a charm (even without BOM :) ).
-losiek (December 29, 2007, 08:15 PM)
--- End quote ---

So locate.exe could be changed to use WriteConsole (if not redirected) and add e.g. '-w' command line argument to use WriteFile and Unicode character set. Then plugin could use that.

But does f0dder want to work with this or do I make required changes?

f0dder:
jmj: I want to play around with it a bit, as soon as I get the thing fully building ;). Is the filename output done exclusively from the two callback functions?

losiek: things are a bit different than that :). WriteConsole can write unicode characters because internally there's two versions of it: *A and *W, one for ansi and one for wide/unicode. WriteFile doesn't have ansi/unicode versions, and simply writes to the target device. There's no way for the console device to know what format it receives from WriteFile, so it opts to only support MultiByte...

There shouldn't be any problem using raw WriteFile when you detect output has been redirected. Or well, THE problem is that you're not outputting a BOM marker, which will confuse e.g. notepad, and that some apps might not be prepared to handle unicode text. The best is probably to convert to UTF-8 when output is redirected...

jmj:
jmj: I want to play around with it a bit, as soon as I get the thing fully building ;). Is the filename output done exclusively from the two callback functions?
-f0dder (December 30, 2007, 06:09 AM)
--- End quote ---

Yes. The another is for filenames using ANSI, so you don't need to change that (unless you wish it).

f0dder:
ANSI output should probably be left as-is; I dunno if WriteConsole has any advantage over WriteFile except for being able to output unicode properly to the console. Sure, probably less conversion layers to go through than WriteFile, but I doubt it's anything measurable.

Need to do some final pre-newyear shopping now, will look at code when I get home.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version