summaryrefslogtreecommitdiffstats
path: root/src/testdisk.c
diff options
context:
space:
mode:
authorChristophe Grenier <[email protected]>2007-11-06 16:40:46 +0100
committerChristophe Grenier <[email protected]>2007-11-06 16:40:46 +0100
commit3fec683bcc0f43b5820e910c3c58a5bc70d08c06 (patch)
tree64b0b9e89a972a6bf23368b791c87a9a0fde0bce /src/testdisk.c
parent249bad4bb750551855f3f1931110d3f493c6f779 (diff)
Handle unicode filenames in display and when copying files from an NTFS partition
Thanks to Kenneth, C H LEE for the first patch
Diffstat (limited to 'src/testdisk.c')
-rw-r--r--src/testdisk.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/testdisk.c b/src/testdisk.c
index 9460bad7..1f942c6d 100644
--- a/src/testdisk.c
+++ b/src/testdisk.c
@@ -252,7 +252,21 @@ int main( int argc, char **argv )
delete_list_disk(list_disk);
return 0;
}
+#ifdef HAVE_SETLOCALE
+ if(run_setlocale>0)
+ {
+ const char *locale;
+ locale = setlocale (LC_ALL, "");
+ if (locale==NULL) {
+ locale = setlocale (LC_ALL, NULL);
+ log_error("Failed to set locale, using default '%s'.\n", locale);
+ } else {
+ log_info("Using locale '%s'.\n", locale);
+ }
+ }
+#endif
#ifdef HAVE_NCURSES
+ /* ncurses need locale for correct unicode support */
if(start_ncurses("TestDisk",argv[0]))
return 1;
#endif
@@ -266,19 +280,6 @@ int main( int argc, char **argv )
log_info("TestDisk %s, Data Recovery Utility, %s\nChristophe GRENIER <[email protected]>\nhttp://www.cgsecurity.org\n",VERSION,TESTDISKDATE);
log_info(TESTDISK_OS);
log_info(" (ext2fs lib: %s, ntfs lib: %s, reiserfs lib: %s, ewf lib: %s)\n",td_ext2fs_version(),td_ntfs_version(),td_reiserfs_version(), td_ewf_version());
-#ifdef HAVE_SETLOCALE
- if(run_setlocale>0)
- {
- const char *locale;
- locale = setlocale (LC_ALL, "");
- if (locale==NULL) {
- locale = setlocale (LC_ALL, NULL);
- log_error("Failed to set locale, using default '%s'.\n", locale);
- } else {
- log_info("Using locale '%s'.\n", locale);
- }
- }
-#endif
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(DJGPP)
#else
#ifdef HAVE_GETEUID