diff options
author | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-03-20 06:17:37 +0400 |
---|---|---|
committer | Alexander Kuznetsov <kuzsasha@gmail.com> | 2012-03-20 06:17:37 +0400 |
commit | f11a6d3a847e8e18faefd8694373d2f11b5ec802 (patch) | |
tree | b4bec6dcfd28e3da4fa1e84ee4bd20fa0a21be39 /source/blender/windowmanager | |
parent | deea1f38b1ec0ccba283abeb63506cbc15e093d5 (diff) |
Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.
Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/CMakeLists.txt | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/SConscript | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 6 |
3 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 521074463e0..2a1a1d5649d 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -136,4 +136,10 @@ if(WITH_BUILDINFO) add_definitions(-DWITH_BUILDINFO) endif() +if(WIN322) + list(APPEND INC + ../../../intern/utfconv + ) +endif() + blender_add_lib_nolist(bf_windowmanager "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript index be037452284..ddb61d721cc 100644 --- a/source/blender/windowmanager/SConscript +++ b/source/blender/windowmanager/SConscript @@ -32,6 +32,7 @@ if env['OURPLATFORM'] == 'linux': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] + incs += ' ../../intern/utfconv' if env['OURPLATFORM'] != 'darwin' or env['WITH_GHOST_COCOA']: sources.remove('intern' + os.sep + 'wm_apple.c') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 1e2c48f4e7f..5384d6ef8f7 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -304,6 +304,7 @@ static void wm_init_userdef(bContext *C) #define BKE_READ_EXOTIC_OK_BLEND 0 /* .blend file */ #define BKE_READ_EXOTIC_OK_OTHER 1 /* other supported formats */ + /* intended to check for non-blender formats but for now it only reads blends */ static int wm_read_exotic(Scene *UNUSED(scene), const char *name) { @@ -319,8 +320,7 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name) retval= BKE_READ_EXOTIC_FAIL_PATH; } else { - gzfile = gzopen(name,"rb"); - + gzfile = BLI_gzopen(name,"rb"); if (gzfile == NULL) { retval= BKE_READ_EXOTIC_FAIL_OPEN; } @@ -627,7 +627,7 @@ static void write_history(void) recent = G.recent_files.first; /* refresh recent-files.txt of recent opened files, when current file was changed */ if(!(recent) || (BLI_path_cmp(recent->filepath, G.main->name)!=0)) { - fp= fopen(name, "w"); + fp= BLI_fopen(name, "w"); if (fp) { /* add current file to the beginning of list */ recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); |