[Bf-blender-cvs] [0b23799] master: Cleanup: remove unused BLI_string_to_utf8

Campbell Barton noreply at git.blender.org
Sat Oct 17 08:12:11 CEST 2015


Commit: 0b23799b6f6470a41a6712461174776faecdfd25
Author: Campbell Barton
Date:   Sat Oct 17 16:00:59 2015 +1100
Branches: master
https://developer.blender.org/rB0b23799b6f6470a41a6712461174776faecdfd25

Cleanup: remove unused BLI_string_to_utf8

===================================================================

M	source/blender/blenlib/BLI_path_util.h
M	source/blender/blenlib/intern/path_util.c
M	source/blender/imbuf/intern/thumbs.c

===================================================================

diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 1be086c..53b3c1d 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -158,10 +158,6 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char
 #  define BLI_path_ncmp strncmp
 #endif
 
-#ifdef WITH_ICONV
-void BLI_string_to_utf8(char *original, char *utf_8, const char *code);
-#endif
-
 /* these values need to be hardcoded in structs, dna does not recognize defines */
 /* also defined in DNA_space_types.h */
 #ifndef FILE_MAXDIR
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index a32e2c0..7a5033a 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1981,38 +1981,3 @@ void BLI_path_native_slash(char *path)
 	BLI_str_replace_char(path + BLI_path_unc_prefix_len(path), '\\', '/');
 #endif
 }
-
-
-#ifdef WITH_ICONV
-
-/**
- * Converts a string encoded in the charset named by *code to UTF-8.
- * Opens a new iconv context each time it is run, which is probably not the
- * most efficient. */
-void BLI_string_to_utf8(char *original, char *utf_8, const char *code)
-{
-	size_t inbytesleft = strlen(original);
-	size_t outbytesleft = 512;
-	size_t rv = 0;
-	iconv_t cd;
-	
-	if (NULL == code) {
-		code = locale_charset();
-	}
-	cd = iconv_open("UTF-8", code);
-
-	if (cd == (iconv_t)(-1)) {
-		printf("iconv_open Error");
-		*utf_8 = '\0';
-		return;
-	}
-	rv = iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft);
-	if (rv == (size_t) -1) {
-		printf("iconv Error\n");
-		iconv_close(cd);
-		return;
-	}
-	*utf_8 = '\0';
-	iconv_close(cd);
-}
-#endif // WITH_ICONV
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index e7bec7e..4e1b5c6 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -243,16 +243,9 @@ static int uri_from_filename(const char *path, char *uri)
 #else
 	BLI_snprintf(orig_uri, URI_MAX, "file://%s", dirstart);
 #endif
-	
-#ifdef WITH_ICONV
-	{
-		char uri_utf8[URI_MAX];
-		escape_uri_string(orig_uri, uri_utf8, URI_MAX, UNSAFE_PATH);
-		BLI_string_to_utf8(uri_utf8, uri, NULL);
-	}
-#else 
+
 	escape_uri_string(orig_uri, uri, URI_MAX, UNSAFE_PATH);
-#endif
+
 	return 1;
 }




More information about the Bf-blender-cvs mailing list