Given an IANA codec name (or, one of those used in iconv/ICU), what is the easiest way to determine whether the codec has a fixed width representation for characters or not?
Use ucnv_isFixedWidth()
:
UErrorCode status;
UConverter* converter = ucnv_open("koi8-r", &status);
if (U_SUCCESS(status)) {
UBool is_fixed = ucnv_isFixedWidth(converter, &status);
}