在 2022/7/8 12:00, Takashi Yano 写道:
On Fri, 8 Jul 2022 12:39:26 +0900 Takashi Yano wrote:### Patch for this issue I attached the PoC patch for this issue. The file name and its location may not be appropriate.I was worried about the overhead, but it seems to get faster with this patch.
Looks like this is caused by __pformat_wputchars( &iargval, 1, &stream ); in 'mingw_pformat.c', which calls _pformat_putc( *p++, stream ); which contains __fputc(c, (FILE *)(stream->dest)); which is a macro in 'mingw_pformat.h': #define __fputc(X,STR) fputc((X), (STR)) and yes, it is subject to the file translation mode, as you have pointed out.However I am afraid the proposed solution would interfere with other code. There 'should' be a way to put characters directly into the stream, ignoring the translation mode.
Also I would like to recommend that wide stdio functions, in addition to C++ wide streams, should not be used to read or write non-ASCII characters; they have never been fully functional.
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public