]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - windows/tahoe.py
Unicode fixes.
[tahoe-lafs/tahoe-lafs.git] / windows / tahoe.py
index 38dd1a7858685e1db2dbf8c17d430c69706bc8e8..42161f48e82e0bb430921e38ff78a82ee70685e1 100644 (file)
@@ -3,5 +3,17 @@ pkgresutil.install() # this is done before nevow is imported by depends
 import depends # import dependencies so that py2exe finds them
 _junk = depends # appease pyflakes
 
+import sys
+from ctypes import WINFUNCTYPE, POINTER, byref, c_wchar_p, c_int, windll
 from allmydata.scripts import runner
-runner.run(install_node_control=False)
+
+GetCommandLineW = WINFUNCTYPE(c_wchar_p)(("GetCommandLineW", windll.kernel32))
+CommandLineToArgvW = WINFUNCTYPE(POINTER(c_wchar_p), c_wchar_p, POINTER(c_int)) \
+                         (("CommandLineToArgvW", windll.shell32))
+
+argc = c_int(0)
+argv = CommandLineToArgvW(GetCommandLineW(), byref(argc))
+argv_utf8 = [argv[i].encode('utf-8') for i in xrange(1, argc.value)]
+
+rc = runner(argv_utf8, install_node_control=False)
+sys.exit(rc)
\ No newline at end of file