[Bug 60139] New: cmd's type cannot handle UTF-8/16 correctly
http://bugs.winehq.org/show_bug.cgi?id=60139 Bug ID: 60139 Summary: cmd's type cannot handle UTF-8/16 correctly Product: Wine Version: 11.14 Hardware: x86-64 OS: Linux Status: NEW Keywords: download, localization, source Severity: trivial Priority: P2 Component: cmd Assignee: wine-bugs@list.winehq.org Reporter: imwellcushtymelike@gmail.com Target Milestone: --- Distribution: --- Created attachment 81736 --> http://bugs.winehq.org/attachment.cgi?id=81736 Simple file Wine's cmd's "type" built-in produces strings of nonsense when reading files encoded as UTF-8 or UTF-16, presumably anything non-ASCII. Attached is a simple file encoded as UTF-8. Another example is using regedit /e to export keys from the registry, which are encoded as UTF-16LE. $ wine cmd
type file A very simple file ^┬┤├ƒ┼é─æ\}╦Ç─æÔåÆ├ª├ƒ─º─æ[Ôåô├ª┬¿
The same file (or registry export) on Windows 10/11 look fine. Adding a BOM doesn't seem to help (Bug 56160), and the BOM itself simply prints as more garbage: ´╗┐A very simple file ^┬┤├ƒ┼é─æ\}╦Ç─æÔåÆ├ª├ƒ─º─æ[Ôåô├ª┬¿ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60139 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|cmd's type cannot handle |cmd's type cannot handle |UTF-8/16 correctly |Unicode correctly --- Comment #1 from Ken Sharp <imwellcushtymelike@gmail.com> --- $ wine cmd start /c type file is a bit quicker. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60139 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81736|text/plain |text/plain;charset=UTF-8 mime type| | -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60139 --- Comment #2 from Ken Sharp <imwellcushtymelike@gmail.com> --- Ah, Wine's cmd matches the behaviour in Windows 95 and NT 4. is_ascii_out = GetConsoleMode(hOut, &console_mode); Do I need to pass a switch to cmd? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60139 Barath Kannan <barathrk11@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |barathrk11@gmail.com --- Comment #3 from Barath Kannan <barathrk11@gmail.com> --- Created attachment 81744 --> http://bugs.winehq.org/attachment.cgi?id=81744 type with UTF-8 With initial testing, the active code page(mapping from byte to character values) is set to 437(Old DOS encoding). This can be obtained via the chcp command without any arguments. Changing to the code page 65001 by using `chcp 65001` and then executing type on the UTF-8 encoded attachment works as expected. This behaviour is the same as shown in Windows 10. From wine's cmd: Microsoft Windows 10.0.19043 Z:\var\home\rkbarath\wine-devel>chcp Active code page: 437 Z:\var\home\rkbarath\wine-devel>type test_type\this A very simple file ^┬┤├ƒ┼é─æ\}╦Ç─æΓåÆ├ª├ƒ─º─æ[Γåô├ª┬¿ Z:\var\home\rkbarath\wine-devel>chcp 65001 Active code page: 65001 Z:\var\home\rkbarath\wine-devel>type test_type\this A very simple file ^´ßłđ\}ˀđ→æßħđ[↓æ¨ Z:\var\home\rkbarath\wine-devel> Check attachment for Win10 output -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60139 --- Comment #4 from Ken Sharp <imwellcushtymelike@gmail.com> --- Indeed, chcp is the magic key. I guess cmd should take the selected Windows version into account when choosing which code page to default to. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla