Site Tools


h-stdmchar

<stdmchar.h>

<stdmchar.h> is a proposed C header (C2y/C3x) designed to fix Unicode handling deficiencies in <wchar.h> and <uchar.h> with cleaner, safer APIs. As of C23, it is not yet standardized and compilers do not ship it.

When standardized, it will provide portable UTF-8 to local encoding transcoding without platform-specific APIs.

Example

This is a placeholder for when the header becomes available; <uchar.h> is the current portable Unicode solution.

// <stdmchar.h> is not yet in the C standard.
// For now, use <uchar.h> or POSIX iconv for Unicode transcoding.

Common proposed functions

When <stdmchar.h> is standardized, it is expected to provide:

  • Unicode normalization: NFC, NFD, NFKC, NFKD forms
  • String validation: UTF-8 validation without conversion
  • Locale-aware encoding: multi-character to local encoding conversion
  • Bidirectional text: support for RTL text handling
  • Grapheme clustering: extended grapheme boundary detection

Current alternatives:

  • <uchar.h>: UTF-32 and UTF-16 conversion
  • POSIX iconv(): arbitrary encoding conversion
  • ICU library: comprehensive Unicode support
h-stdmchar.md · Last modified: by 127.0.0.1