Don't break for CONC on a space boundary.
[gedcom-parse.git] / gedcom / encoding.c
index 1cae728808f5c8dfd9f9cf6556f4c575a20e78dd..c2c3e8980686ae72d30f79d29057f988de278bb1 100644 (file)
@@ -89,6 +89,10 @@ char* get_encoding(const char* gedcom_n, Encoding enc)
   key = (char*)malloc(strlen(gedcom_n) + strlen(charwidth_string[enc]) + 3);
 
   if (key) {
+    char* sp_pos = NULL;
+    while ((sp_pos = strchr(gedcom_n, ' ')) != NULL) {
+      *sp_pos = '_';
+    }
     /* sprintf is safe here (malloc'ed before) */
     sprintf(key, "%s(%s)", gedcom_n, charwidth_string[enc]);