0

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?

一二三
  • 21,059
  • 11
  • 65
  • 74
Frank-Rene Schäfer
  • 3,182
  • 27
  • 51

1 Answers1

1

Use ucnv_isFixedWidth():

UErrorCode status;
UConverter* converter = ucnv_open("koi8-r", &status);
if (U_SUCCESS(status)) {
  UBool is_fixed = ucnv_isFixedWidth(converter, &status);
}
一二三
  • 21,059
  • 11
  • 65
  • 74