in reply to Re^4: unpacking wmic command's unicode output
in thread unpacking wmic command's unicode output
Does wmic really output UTF-8?
It appears it does (some form of unicode anyway), if you redirect its output to a file (or via a pipe):
c:\test>wmic.exe process > junk c:\test>u:head -c 200 junk ■C a p t i o n C o m m a n d L i n +e
That first spludge(*) is the LE BOM 0xfffe. (It was a spludge when I c&p'd it!)
Probably utf-16le I think, but whatever it is, using -CS does seem to cause perl to work out what it is getting and treat it appropriately:
c:\test>wmic.exe process | perl -CS -pe1 > junk c:\test>u:head -c 200 junk Caption CommandLine
Whether by accident or design, it is useful.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: unpacking wmic command's unicode output
by ikegami (Patriarch) on Nov 12, 2008 at 19:02 UTC | |
by goibhniu (Hermit) on Nov 12, 2008 at 20:57 UTC | |
by ikegami (Patriarch) on Nov 12, 2008 at 21:15 UTC | |
by goibhniu (Hermit) on Nov 12, 2008 at 21:19 UTC | |
by ikegami (Patriarch) on Nov 12, 2008 at 21:26 UTC | |
|