Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-20 13:47:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-20 13:47:05 +0400
commit8d6a554d7502029f04aca33efcdd004744b9bd84 (patch)
tree027f5dec3ea38784d3108f8d9b5c4a008bae7fb4 /source/blender/python
parente02dfe4a79b3632b3143d5d45e0dee1463ff7aa6 (diff)
- add BLI_string_utf8.h for unicode functions.
- move font.c unicode functions into string_utf8.c and rename to fit with other BLI_string funcs.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c4
-rw-r--r--source/blender/python/intern/bpy_interface.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index e658532db24..575495e186e 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -30,7 +30,7 @@
#include "py_capi_utils.h"
-#include "BKE_font.h" /* only for utf8towchar, should replace with py funcs but too late in release now */
+#include "BLI_string_utf8.h" /* only for BLI_strncpy_wchar_from_utf8, should replace with py funcs but too late in release now */
#ifdef _WIN32 /* BLI_setenv */
#include "BLI_path_util.h"
@@ -478,7 +478,7 @@ void PyC_SetHomePath(const char *py_path_bundle)
/* cant use this, on linux gives bug: #23018, TODO: try LANG="en_US.UTF-8" /usr/bin/blender, suggested 22008 */
/* mbstowcs(py_path_bundle_wchar, py_path_bundle, FILE_MAXDIR); */
- utf8towchar(py_path_bundle_wchar, py_path_bundle);
+ BLI_strncpy_wchar_from_utf8(py_path_bundle_wchar, py_path_bundle, sizeof(py_path_bundle_wchar) / sizeof(wchar_t));
Py_SetPythonHome(py_path_bundle_wchar);
// printf("found python (wchar_t) '%ls'\n", py_path_bundle_wchar);
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index aaa813137c6..ddbd557375c 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -52,12 +52,12 @@
#include "BLI_path_util.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
+#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_text.h"
-#include "BKE_font.h" /* only for utf8towchar */
#include "BKE_main.h"
#include "BKE_global.h" /* only for script checking */
@@ -194,7 +194,7 @@ void BPY_python_start(int argc, const char **argv)
/* not essential but nice to set our name */
static wchar_t bprogname_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */
- utf8towchar(bprogname_wchar, bprogname);
+ BLI_strncpy_wchar_from_utf8(bprogname_wchar, bprogname, sizeof(bprogname_wchar) / sizeof(wchar_t));
Py_SetProgramName(bprogname_wchar);
/* must run before python initializes */