- /*
- * For character sets that include the copyright symbol,
- * the first 5 characters suffices to distinguish amongst
- * all the different possible encodings.
- */
- static const char t1[][5] = {
- "CP112",
- "CP125",
- "CP775",
- "CP850",
- "CP856",
- "CP857",
- "CP869",
- "CP922",
- "EUC-J",
- "GB180",
- "GEORG",
- "ISO-8",
- "KOI8-",
- "PT154",
- "UTF-8"
+ static const struct copysym_data data = {
+ /*
+ * For character sets that include the copyright symbol,
+ * the first 5 characters suffices to distinguish amongst
+ * all the different possible encodings.
+ *
+ * The final byte of each entry indicates the corresponding
+ * offset into the codes array, except for CP112x and ISO-8859
+ * which use the values 0 and 1, respectively (handled below).
+ */
+ .tab =
+ {
+ "CP112\x00",
+ "CP125\x05",
+ "CP775\x09",
+ "CP850\x0b",
+ "CP856\x0b",
+ "CP857\x0b",
+ "CP869\x07",
+ "CP922\x05",
+ "EUC-J\x0f",
+ "GB180\x13",
+ "GEORG\x05",
+ "ISO-8\x01",
+ "KOI8-\x0d",
+ "PT154\x05",
+ "UTF-8\x04"
+ },
+
+ /* All known encodings of the copyright symbol. */
+ .codes =
+ "(C)" "\0"
+ "\xc2\xa9" "\0"
+ "\x97" "\0"
+ "\xa8" "\0"
+ "\xb8" "\0"
+ "\xbf" "\0"
+ "\x8f\xa2\xed" "\0"
+ "\x81\x30\x84\x38"