mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] [PATCH 1/7] new option filenames_utf8


From: ygrek
Subject: [Mldonkey-users] [PATCH 1/7] new option filenames_utf8
Date: Mon, 18 Jun 2012 00:20:36 +0300

use utf8 for filenames disregarding the locale setting
---
 src/daemon/common/commonInteractive.ml |    2 +-
 src/daemon/common/commonOptions.ml     |    5 +++--
 src/daemon/driver/driverCommands.ml    |    1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/daemon/common/commonInteractive.ml 
b/src/daemon/common/commonInteractive.ml
index 48f32c8..b407301 100644
--- a/src/daemon/common/commonInteractive.ml
+++ b/src/daemon/common/commonInteractive.ml
@@ -84,7 +84,7 @@ let canonize_basename name =
         Charset.add_uchar buf uc'
       end
   done;
-  if not Autoconf.windows then
+  if not Autoconf.windows && not !!filenames_utf8 then
     Charset.Locale.to_locale (Buffer.contents buf)
   else
     Buffer.contents buf (* Windows uses patched Ocaml which always uses 
Unicode chars *)
diff --git a/src/daemon/common/commonOptions.ml 
b/src/daemon/common/commonOptions.ml
index fc91bd0..baf907e 100644
--- a/src/daemon/common/commonOptions.ml
+++ b/src/daemon/common/commonOptions.ml
@@ -1396,8 +1396,9 @@ let mldonkey_gui = define_expert_option current_section 
["mldonkey_gui"]
   "Name of GUI to start"
     string_option (Filename.concat bin_dir "mlgui")
 
-
-
+let filenames_utf8 = define_option current_section ["filenames_utf8"]
+  "Use UTF-8 for filenames (instead of automatic locale detection)."
+    bool_option false
 
 (*************************************************************************)
 (*                                                                       *)
diff --git a/src/daemon/driver/driverCommands.ml 
b/src/daemon/driver/driverCommands.ml
index 1878cff..1b5e346 100644
--- a/src/daemon/driver/driverCommands.ml
+++ b/src/daemon/driver/driverCommands.ml
@@ -2088,6 +2088,7 @@ action=\\\"javascript:pluginSubmit();\\\"\\>";
                       [
                        strings_of_option previewer;
                        strings_of_option temp_directory;
+                       strings_of_option filenames_utf8;
                        strings_of_option share_scan_interval;
                        strings_of_option hdd_temp_minfree;
                        strings_of_option hdd_temp_stop_core;
-- 
1.7.10




reply via email to

[Prev in Thread] Current Thread [Next in Thread]