Index: /test/regfi-threadtest.c
===================================================================
--- /test/regfi-threadtest.c	(revision 262)
+++ /test/regfi-threadtest.c	(revision 263)
@@ -169,4 +169,5 @@
 
   regfi_iterator_free(iter);
+  fprintf(stderr, "INFO: thread finished\n");
 
   return NULL;
@@ -188,5 +189,5 @@
 
   num_threads = 10;
-  num_iterations = 10;
+  num_iterations = 2;
 
   /* Process command line arguments */
Index: /trunk/include/regfi.h
===================================================================
--- /trunk/include/regfi.h	(revision 262)
+++ /trunk/include/regfi.h	(revision 263)
@@ -1483,5 +1483,4 @@
 _EXPORT()
 REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset, 
-                         REGFI_ENCODING output_encoding, 
                          bool strict);
 
@@ -1495,5 +1494,4 @@
 _EXPORT()
 REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, 
-                           REGFI_ENCODING output_encoding, 
                            bool strict);
 
@@ -1558,5 +1556,4 @@
 _EXPORT()
 bool regfi_interpret_data(REGFI_FILE* file, 
-			  REGFI_ENCODING string_encoding,
 			  uint32_t type, REGFI_DATA* data);
 
@@ -1766,9 +1763,7 @@
 
 _EXPORT()
-void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, 
-			     REGFI_ENCODING output_encoding, bool strict);
-_EXPORT()
-void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, 
-			       REGFI_ENCODING output_encoding, bool strict);
+void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, bool strict);
+_EXPORT()
+void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, bool strict);
 
 _EXPORT()
Index: /trunk/lib/regfi.c
===================================================================
--- /trunk/lib/regfi.c	(revision 262)
+++ /trunk/lib/regfi.c	(revision 263)
@@ -1175,6 +1175,5 @@
 
 /* XXX: should give this boolean return type to indicate errors */
-void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, 
-			       REGFI_ENCODING output_encoding, bool strict)
+void regfi_interpret_valuename(REGFI_FILE* file, REGFI_VK* vk, bool strict)
 {
   /* XXX: Registry value names are supposedly limited to 16383 characters 
@@ -1193,5 +1192,5 @@
     return;
 
-  if(from_encoding == output_encoding)
+  if(from_encoding == file->string_encoding)
   {
     vk->name_raw[vk->name_length] = '\0';
@@ -1201,5 +1200,5 @@
   {
     tmp_buf = regfi_conv_charset(regfi_encoding_int2str(from_encoding),
-                                 regfi_encoding_int2str(output_encoding),
+                                 regfi_encoding_int2str(file->string_encoding),
                                  vk->name_raw, vk->name_length);
     if(tmp_buf.buf == NULL)
@@ -1207,5 +1206,5 @@
       regfi_log_add(REGFI_LOG_WARN, "Error occurred while converting"
 			" value name to encoding %s.  Error message: %s",
-			regfi_encoding_int2str(output_encoding), 
+			regfi_encoding_int2str(file->string_encoding),
 			strerror(errno));
       vk->name = NULL;
@@ -1222,6 +1221,5 @@
 /******************************************************************************
  ******************************************************************************/
-REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, 
-			   REGFI_ENCODING output_encoding, bool strict)
+REGFI_VK* regfi_load_value(REGFI_FILE* file, uint32_t offset, bool strict)
 {
   REGFI_VK* ret_val = NULL;
@@ -1236,5 +1234,5 @@
     return NULL;
 
-  regfi_interpret_valuename(file, ret_val, output_encoding, strict);
+  regfi_interpret_valuename(file, ret_val, strict);
 
   return ret_val;
@@ -1269,6 +1267,5 @@
 
 /* XXX: should give this boolean return type to indicate errors */
-void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, 
-			     REGFI_ENCODING output_encoding, bool strict)
+void regfi_interpret_keyname(REGFI_FILE* file, REGFI_NK* nk, bool strict)
 {
   /* XXX: Registry key names are supposedly limited to 255 characters according to:
@@ -1286,5 +1283,5 @@
     return;  
 
-  if(from_encoding == output_encoding)
+  if(from_encoding == file->string_encoding)
   {
     nk->name_raw[nk->name_length] = '\0';
@@ -1294,5 +1291,5 @@
   {
     tmp_buf = regfi_conv_charset(regfi_encoding_int2str(from_encoding),
-                                 regfi_encoding_int2str(output_encoding),
+                                 regfi_encoding_int2str(file->string_encoding),
                                  nk->name_raw, nk->name_length);
     if(tmp_buf.buf == NULL)
@@ -1300,5 +1297,5 @@
       regfi_log_add(REGFI_LOG_WARN, "Error occurred while converting"
                     " key name to encoding %s.  Error message: %s",
-                    regfi_encoding_int2str(output_encoding), 
+                    regfi_encoding_int2str(file->string_encoding), 
                     strerror(errno));
       nk->name = NULL;
@@ -1316,6 +1313,5 @@
  *
  ******************************************************************************/
-REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset,
-			 REGFI_ENCODING output_encoding, bool strict)
+REGFI_NK* regfi_load_key(REGFI_FILE* file, uint32_t offset, bool strict)
 {
   REGFI_NK* nk;
@@ -1353,5 +1349,5 @@
   }
 
-  regfi_interpret_keyname(file, nk, output_encoding, strict);
+  regfi_interpret_keyname(file, nk, strict);
 
   /* get value list */
@@ -1494,6 +1490,5 @@
 /******************************************************************************
  ******************************************************************************/
-REGFI_NK* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin, 
-			     REGFI_ENCODING output_encoding)
+REGFI_NK* regfi_find_root_nk(REGFI_FILE* file, const REGFI_HBIN* hbin)
 {
   REGFI_NK* nk = NULL;
@@ -1521,5 +1516,5 @@
     if(!unalloc)
     {
-      nk = regfi_load_key(file, cur_offset, output_encoding, true);
+      nk = regfi_load_key(file, cur_offset, true);
       if(nk != NULL)
       {
@@ -1738,5 +1733,5 @@
 
   root_offset = file->root_cell+REGFI_REGF_SIZE;
-  nk = regfi_load_key(file, root_offset, file->string_encoding, true);
+  nk = regfi_load_key(file, root_offset, true);
   if(nk != NULL)
   {
@@ -1760,5 +1755,5 @@
   {
     hbin = (REGFI_HBIN*)range_list_get(file->hbins, i)->data;
-    nk = regfi_find_root_nk(file, hbin, file->string_encoding);
+    nk = regfi_find_root_nk(file, hbin);
   }
 
@@ -2042,5 +2037,5 @@
   const REGFI_NK* ret_val = NULL;
 
-  ret_val = regfi_load_key(i->f, i->cur->offset, i->f->string_encoding, true);
+  ret_val = regfi_load_key(i->f, i->cur->offset, true);
   return ret_val;
 }
@@ -2211,7 +2206,7 @@
       cur != NULL; cur=void_stack_iterator_next(iter))
   { 
-    ret_val[k++] = regfi_load_key(i->f, cur->offset, i->f->string_encoding, true); 
-  }
-  ret_val[k] = regfi_load_key(i->f, i->cur->offset, i->f->string_encoding, true);
+    ret_val[k++] = regfi_load_key(i->f, cur->offset, true); 
+  }
+  ret_val[k] = regfi_load_key(i->f, i->cur->offset, true);
   void_stack_iterator_free(iter);
 
@@ -2324,6 +2319,5 @@
       }
 
-      if(!regfi_interpret_data(file, file->string_encoding, 
-			       value->type, ret_val))
+      if(!regfi_interpret_data(file, value->type, ret_val))
       {
 	regfi_log_add(REGFI_LOG_INFO, "Error occurred while"
@@ -2425,6 +2419,6 @@
   {
     return regfi_load_key(file, 
-			  key->subkeys->elements[index].offset+REGFI_REGF_SIZE,
-			  file->string_encoding, true);
+                          key->subkeys->elements[index].offset+REGFI_REGF_SIZE, 
+                          true);
   }
 
@@ -2442,5 +2436,5 @@
     return regfi_load_value(file, 
 			    key->values->elements[index]+REGFI_REGF_SIZE,
-			    file->string_encoding, true);
+                            true);
   }
 
@@ -2456,6 +2450,5 @@
   if(key != NULL && key->parent_off != REGFI_OFFSET_NONE)
     return regfi_load_key(file, 
-                          key->parent_off+REGFI_REGF_SIZE,
-                          file->string_encoding, true);
+                          key->parent_off+REGFI_REGF_SIZE, true);
 
   return NULL;
@@ -2489,6 +2482,5 @@
 /******************************************************************************
  *****************************************************************************/
-bool regfi_interpret_data(REGFI_FILE* file, REGFI_ENCODING string_encoding,
-			  uint32_t type, REGFI_DATA* data)
+bool regfi_interpret_data(REGFI_FILE* file, uint32_t type, REGFI_DATA* data)
 {
   REGFI_BUFFER tmp_buf;
@@ -2506,5 +2498,5 @@
   case REG_LINK:
     tmp_buf = regfi_conv_charset(regfi_encoding_int2str(REGFI_ENCODING_UTF16LE),
-                                 regfi_encoding_int2str(string_encoding),
+                                 regfi_encoding_int2str(file->string_encoding),
                                  data->raw, data->size);
     if(tmp_buf.buf == NULL)
@@ -2513,5 +2505,5 @@
 		    " converting data of type %d to string encoding %d."
                     "  Error message: %s",
-		    type, string_encoding, strerror(errno));
+		    type, file->string_encoding, strerror(errno));
       data->interpreted.string = NULL;
       data->interpreted_size = 0;
@@ -2563,5 +2555,5 @@
      */
     tmp_buf = regfi_conv_charset(regfi_encoding_int2str(REGFI_ENCODING_UTF16LE),
-                                 regfi_encoding_int2str(string_encoding),
+                                 regfi_encoding_int2str(file->string_encoding),
                                  data->raw, data->size);
     if(tmp_buf.buf == NULL)
@@ -2570,5 +2562,5 @@
 		    " converting data of type %d to string encoding %d."
                     "  Error message: %s",
-		    type, string_encoding, strerror(errno));
+		    type, file->string_encoding, strerror(errno));
       data->interpreted.multiple_string = NULL;
       data->interpreted_size = 0;
Index: /trunk/src/reglookup-recover.c
===================================================================
--- /trunk/src/reglookup-recover.c	(revision 262)
+++ /trunk/src/reglookup-recover.c	(revision 263)
@@ -76,5 +76,5 @@
   
   /* XXX: Add command line option to choose output encoding */
-  regfi_interpret_keyname(f, nk, REGFI_ENCODING_ASCII, true);
+  regfi_interpret_keyname(f, nk, true);
 
   quoted_name = get_quoted_keyname(nk);
@@ -112,5 +112,5 @@
 
   /* XXX: Add command line option to choose output encoding */
-  regfi_interpret_valuename(f, vk, REGFI_ENCODING_ASCII, true);
+  regfi_interpret_valuename(f, vk, true);
   
   quoted_name = get_quoted_valuename(vk);
@@ -129,5 +129,5 @@
   /* XXX: Add command line option to choose output encoding */
   if(vk->data != NULL 
-     && !regfi_interpret_data(f, REGFI_ENCODING_ASCII, vk->type, vk->data))
+     && !regfi_interpret_data(f, vk->type, vk->data))
   {
     fprintf(stderr, "WARN: Error occurred while interpreting data for VK record"
@@ -282,5 +282,5 @@
 	{
 	  /* XXX: Add command line option to choose output encoding */
-	  regfi_interpret_keyname(f, cur_ancestor, REGFI_ENCODING_ASCII, true);
+	  regfi_interpret_keyname(f, cur_ancestor, true);
 	  
 	  path_element->buf = (uint8_t*)get_quoted_keyname(cur_ancestor);
@@ -943,5 +943,5 @@
     {
       /* XXX: Add command line option to choose output encoding */
-      regfi_interpret_keyname(f, tmp_key, REGFI_ENCODING_ASCII, true);
+      regfi_interpret_keyname(f, tmp_key, true);
 
       tmp_name = get_quoted_keyname(tmp_key);
