I'm not sure, but it seems we are using the term "pipe" for different things.
I call only the unnamed pipe object the "pipe", and "piping" is writing raw data to and reading raw data from this (unnamed) pipe object.
You seem to use the term "pipe" for what i call "piping", and to define "piping" as what i would call data encoding and data interpretation.
If that is the case then we both are right.
If there is at least one way to reliably write raw data to and read from a pipe,
then the pipe (object functionality) is not broken (findstr example above).
This does not mean that data encoding/interpretation will success: This is the part that fails (no matter if in a patched or unpatched cmd.exe, i think).
I only can guess, but i think your examples of 'broken piping' can be caused in default (non patched) cmd.exe versions, too:
Code: Select all
Z:\>cmd /U
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
Z:\>chcp
Aktive Codepage: 850.
Z:\>cmd /u /c set /P "=echo echo abc" ^< nul | cmd /u /k chcp
Aktive Codepage: 850.
Z:\>Mehr?
Z:\>
Z:\>cmd /u /c echo echo abc| cmd /u /k chcp
Aktive Codepage: 850.
Z:\>Mehr? Der Befehl "e" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Z:\>
It is just a(nother) bug of (unpatched) cmd when reading unicode (i think as UTF-8 is unicode too, this bug occurs in any cmd mode (/A, /U).
(There are also examples where the below example produce a 0x03 character at the end, too. But actualy i can't remember how to produce this bug ... maybe it has been fixed ... i don't know.)
Sad to say, i have no idea what is causing this bug, as the raw data survives unchanged, and i even can't imagine why unchanged data may be misinterpreted... .
In addition i have no idea, why the above example fails, as no (en)coding in any way is needed (pipe supports UCS2, input/output is UCS2):
Code: Select all
Z:\>cmd /u /c set /P "=echo abc" ^<nul | cmd /u /c findstr "^"
e.c.h.o. .a.b.c.
(You may redirect it to file, to see that the raw data is without any error.)
penpen
Edit: Added the last example.