Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-20 Thread Peter0x44
Thanks for the patch. I notice that libcpp/charset.cc defines a function convert_utf8_utf16 (albeit currently static). Is there a way that this could be reused, rather than adding a 2nd implementation? From what I can tell, it calls libiconv, which can't be assumed to be present. So despi

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-15 Thread LIU Hao
在 2025-9-16 00:10, David Malcolm 写道: I notice that libcpp/charset.cc defines a function convert_utf8_utf16 (albeit currently static). Is there a way that this could be reused, rather than adding a 2nd implementation? On Windows there's `MultiByteToWideChar()` which can do UTF-8-to-UTF-16 conve

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-15 Thread Jonathan Yong
On 9/15/25 6:26 PM, Peter0x44 wrote: On 2025-09-15 19:04, Jonathan Yong wrote: On 9/15/25 4:33 PM, Peter0x44 wrote: Thanks for the patch. I notice that libcpp/charset.cc defines a function convert_utf8_utf16 (albeit currently static).  Is there a way that this could be reused, rather than a

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-15 Thread Peter0x44
On 2025-09-15 19:04, Jonathan Yong wrote: On 9/15/25 4:33 PM, Peter0x44 wrote: Thanks for the patch. I notice that libcpp/charset.cc defines a function convert_utf8_utf16 (albeit currently static).  Is there a way that this could be reused, rather than adding a 2nd implementation? From wh

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-15 Thread Jonathan Yong
On 9/15/25 4:33 PM, Peter0x44 wrote: Thanks for the patch. I notice that libcpp/charset.cc defines a function convert_utf8_utf16 (albeit currently static).  Is there a way that this could be reused, rather than adding a 2nd implementation? From what I can tell, it calls libiconv, which can

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-15 Thread David Malcolm
On Fri, 2025-09-12 at 16:45 +0100, Peter Damianov wrote: > UTF-8 characters in diagnostic output (such as the warning emoji ⚠️ > used by fanalyzer) display as mojibake on Windows unless the utf8 > code page is being used > > This patch adds UTF-8 to UTF-16 conversion when outputting to a > console

Re: [PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-13 Thread Jonathan Yong
On 9/12/25 3:45 PM, Peter Damianov wrote: UTF-8 characters in diagnostic output (such as the warning emoji ⚠️ used by fanalyzer) display as mojibake on Windows unless the utf8 code page is being used This patch adds UTF-8 to UTF-16 conversion when outputting to a console on Windows. gcc/ChangeL

[PATCH v2] diagnostics: Fix mojibake from displaying UTF-8 on Windows consoles

2025-09-12 Thread Peter Damianov
UTF-8 characters in diagnostic output (such as the warning emoji ⚠️ used by fanalyzer) display as mojibake on Windows unless the utf8 code page is being used This patch adds UTF-8 to UTF-16 conversion when outputting to a console on Windows. gcc/ChangeLog: * pretty-print.cc (decode_utf8_c