在 2023/3/24 16:47, LIU Hao 写道:
rom 544a196787132e0ceae01fe2f0f6c62e76da0e05 Mon Sep 17 00:00:00 2001
From: LIU Hao<[email protected]>
Date: Fri, 24 Mar 2023 16:38:51 +0800
Subject: [PATCH] crt: Remove conversion functions between UTF-{16,32}
  characters from MSVCRT

Microsoft documentation says these functions operate between UTF-8 and
UTF-{16,32}. However, the function `mbrtoc16()` delegates to `mbrtowc()`
which handles only DBCS encodings; the legacy MSVCRT does not have UTF-8
support. `mbrtoc32()` on the other hand igores the `mbstate_t` argument
and is non-restartable. So neither conforms to the C standard.

This commit removes those incorrect functions from MSVCRT. In order to
get UTF-8 support, users should link against UCRT.

Reference:https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mbrtoc16-mbrtoc323?view=msvc-170
Signed-off-by: LIU Hao<[email protected]>
---


Ping on this patch. A blank line got deleted by accident. I can fix that 
locally.

Removal of stuff could be bad, but given that `mbstoc16()` has never been working, it might not be a big loss.




--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to