- /* Use "from,to" or just "from" */
- const char *cp = strchr(record_charset, ',');
- size_t clen = strlen(record_charset);
- if (cp && cp[1])
+ char *cp = charset_buf;
+
+ strncpy(charset_buf, record_charset, sizeof(charset_buf)-1);
+ charset_buf[sizeof(charset_buf)-1] = '\0';
+
+ from_set1 = cp;
+ while (*cp && *cp != ',' && *cp != '/')
+ cp++;
+ if (*cp == '/')