https://bugs.winehq.org/show_bug.cgi?id=53939
Bug ID: 53939 Summary: TextOut will output ASCII control character(0~31) as tofu cause crash Product: Wine Version: 7.12 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: blocker Priority: P2 Component: gdi32 Assignee: wine-bugs@winehq.org Reporter: 399989567@qq.com Distribution: ---
TextOut will output ASCII control character(0~31) as tofu cause crash
build a string on windows
static WCHAR str[] = {0x1c,0x30,0x31,0x32,0}
use TextOut(hdc,x,y,str,wcslen(str)) to output this str
on windows: output is "012" on wine : output is "?012"
The reason is that this API does not filter ASCII control characters, and treats the control characters as an ordinary character to output.
by the way if we fillter the control character we alse need fix the API :GetTextExtentExPointW
Because my program uses control characters, there will be problems when calculating the length, resulting in a crash. If I filter out the control characters in the code myself, it will not crash. And in principle, the focus should be on whether control characters should be output
https://bugs.winehq.org/show_bug.cgi?id=53939
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|blocker |normal CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Not a blocker.
Can we have another sample program here?
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #2 from 399989567@qq.com --- (In reply to Fabian Maurer from comment #1)
Not a blocker.
Can we have another sample program here?
of course
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #3 from 399989567@qq.com --- Created attachment 73507 --> https://bugs.winehq.org/attachment.cgi?id=73507 demo on windows10
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #4 from 399989567@qq.com --- Created attachment 73508 --> https://bugs.winehq.org/attachment.cgi?id=73508 Figure1
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #5 from 399989567@qq.com --- (In reply to Fabian Maurer from comment #1)
Not a blocker.
Can we have another sample program here?
The width of the orange is 25, the width of "启" is 20,
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #6 from Fabian Maurer dark.shadow4@web.de --- Alright, although I don't get a crash on Wine.
https://bugs.winehq.org/show_bug.cgi?id=53939
--- Comment #7 from 399989567@qq.com --- (In reply to Fabian Maurer from comment #6)
Alright, although I don't get a crash on Wine.
This demo won't crash, it's because I have an own application that contains a lot of ASCII control characters in the output string, so it will generate extra values in rendering and length calculation, resulting in a crash, but in essence Unexpected output of ASCII control symbols is indeed a problem.
https://bugs.winehq.org/show_bug.cgi?id=53939
Petrichor Park ppark@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ppark@codeweavers.com
--- Comment #8 from Petrichor Park ppark@codeweavers.com --- Hello, Would you mind attaching the source code of your test program?