#include "gedcom_internal.h"
#include "gedcom.h"
#include "encoding.h"
+#include "encoding_state.h"
#include "hash.h"
#include "utf8tools.h"
#define GCONV_SEARCH_PATH "GCONV_PATH"
#define MAXBUF 255
-static Encoding the_enc = ONE_BYTE;
static hash_t *encodings = NULL;
const char* charwidth_string[] = { "1", "2_HILO", "2_LOHI" };
}
}
-void set_encoding_width(Encoding enc)
-{
- the_enc = enc;
-}
-
static convert_t to_int = NULL;
static char* error_value = "<error>";
int open_conv_to_internal(const char* fromcode)
{
convert_t new_to_int = NULL;
- const char *encoding = get_encoding(fromcode, the_enc);
+ const char *encoding = get_encoding(fromcode, read_encoding.width);
if (encoding != NULL) {
new_to_int = initialize_utf8_conversion(encoding, 1);
if (to_int != NULL)
cleanup_utf8_conversion(to_int);
to_int = new_to_int;
+ set_read_encoding(fromcode, encoding);
}
return (new_to_int != NULL);