[libc-commits] [libc] [libc] Character converter skeleton class (PR #143619)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Jun 10 16:11:49 PDT 2025


================
@@ -0,0 +1,20 @@
+
+#include "hdr/types/wchar_t.h"
+#include "src/__support/wchar/mbstate.h"
+#include "src/__support/wchar/utf_ret.h"
+
+class CharacterConverter {
+private:
+  mbstate_t *state;
+
+public:
+  CharacterConverter();
+
+  bool isComplete();
+
+  int push(char utf8_byte);
+  int push(wchar_t utf32);
----------------
michaelrj-google wrote:

anywhere you need specifically utf-32 you should use `char32_t`, and for utf-8 you should use `char8_t`.

https://github.com/llvm/llvm-project/pull/143619


More information about the libc-commits mailing list