Search code examples
c++utf-8charutf-16utf

Are char8_t and char16_t dynamic in size?


Here is what I know:

  • "UTF-8 is a variable-length character encoding standard used for electronic communication."
  • Likewise, UTF-16 is a variable-length character encoding.

Here is what I wonder:

  • Are char8_t and char16 in C++ are dynamic in size too (to fit in the generic behaviour of UTF-8 and UTF-16)?
  • Will it ever happen that when I assign it a specical value, it automatically expands its own size to match?

Solution

  • char8_t and char16_t are dynamic in size?

    No.

    Are char8_t and char16_t in C++ are dynamic in size too (to fit in the generic behaviour of UTF-8 and UTF-16) ?

    No.

    Will it ever happen that when I assign it a "special" value, it will automatically expand its own size to match?

    No.