Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Capture Unicode command line output

Current License: CC BY-SA 4.0

16 events
when toggle format what by license comment
Nov 19, 2023 at 1:10 review Close votes
Nov 23, 2023 at 0:04
Nov 19, 2023 at 0:12 history edited Some1Else CC BY-SA 4.0
added 338 characters in body
Feb 21, 2023 at 3:14 comment added AmigoJack Nobody reads my links either: "lpCommandLine: The Unicode version of this function, CreateProcessW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation." - hence CreateProcessA() is used here, because W() would crash on a literal.
Feb 21, 2023 at 3:09 history edited Some1Else CC BY-SA 4.0
added 154 characters in body
Feb 20, 2023 at 21:43 history edited AmigoJack CC BY-SA 4.0
casing; more tags
Feb 20, 2023 at 21:37 answer added AmigoJack timeline score: 1
Feb 20, 2023 at 20:23 comment added Some1Else OK, changing to CreateProcessW doesn't seem to help. Using AnsiChar, Char and WideChar no help. /U added to cmd.exe no help. Can you try the reproducible code to see if you can get it working?
Feb 20, 2023 at 19:59 comment added JosefZ @AmigoJack -A vs. -W APIs in Use UTF-8 code pages in Windows apps here... The 2nd mojibake described above shows rather CreateProcessW in effect...
Feb 20, 2023 at 19:49 comment added AmigoJack Since you program doesn't crash you effectively call CreateProcessA() and not CreateProcessW() - the latter needs a writeable second parameter instead of a literal only. Run Unicode, get Unicode.
Feb 20, 2023 at 19:49 comment added JosefZ You face a mojibake case (example in Python for its universal intelligibility): the 1st example '│ ├───'.encode( 'cp850').decode( 'cp1252') returns ³ ÃÄÄÄ and the 2nd (truncated) '‱楦敬猨 潭敶⹤਍††††‱楦敬猨'.encode( 'utf-16-le'). decode( 'utf-8') returns 1 file(s) moved.\r\n 1 file(s
Feb 20, 2023 at 19:36 comment added Some1Else That sounded like a solution, but adding /U to the createprocess cmd.exe commandline did not make any difference.
Feb 20, 2023 at 19:33 comment added AmigoJack When you use pipes, you need to use /U, too.
Feb 20, 2023 at 19:20 history edited Some1Else CC BY-SA 4.0
added 314 characters in body
Feb 20, 2023 at 19:12 history edited Some1Else CC BY-SA 4.0
added 314 characters in body
Feb 20, 2023 at 19:05 comment added JosefZ Please edit your question to improve your minimal reproducible example. In particular, share a sample input (what you expect) and corrupted output (what you get).
Feb 20, 2023 at 18:41 history asked Some1Else CC BY-SA 4.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /