| 2755 | } |
| 2756 | |
| 2757 | static void |
| 2758 | processEncodingEntry(ArchiveHandle *AH, TocEntry *te) |
| 2759 | { |
| 2760 | /* te->defn should have the form SET client_encoding = 'foo'; */ |
| 2761 | char *defn = pg_strdup(te->defn); |
| 2762 | char *ptr1; |
| 2763 | char *ptr2 = NULL; |
| 2764 | int encoding; |
| 2765 | |
| 2766 | ptr1 = strchr(defn, '\''); |
| 2767 | if (ptr1) |
| 2768 | ptr2 = strchr(++ptr1, '\''); |
| 2769 | if (ptr2) |
| 2770 | { |
| 2771 | *ptr2 = '\0'; |
| 2772 | encoding = pg_char_to_encoding(ptr1); |
| 2773 | if (encoding < 0) |
| 2774 | fatal("unrecognized encoding \"%s\"", |
| 2775 | ptr1); |
| 2776 | AH->public.encoding = encoding; |
| 2777 | setFmtEncoding(encoding); |
| 2778 | } |
| 2779 | else |
| 2780 | fatal("invalid ENCODING item: %s", |
| 2781 | te->defn); |
| 2782 | |
| 2783 | free(defn); |
| 2784 | } |
| 2785 | |
| 2786 | static void |
| 2787 | processStdStringsEntry(ArchiveHandle *AH, TocEntry *te) |
no test coverage detected