From a1e64cf2e7ec65fde4e8a7012adb74a1d4528269 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Sun, 18 Feb 2024 09:51:01 +0000 Subject: [PATCH] Force EXIV2_ENABLE_WIN_UNICODE=OFF always The code-page to utf-8 translation works OK and is required for exiv2 v0.28.x anyway, so ignoring the wchar versions of some methods entirely makes sense. --- .github/workflows/build-windows-27.yml | 2 +- src/interface/shared/windows_path.i | 15 ++++++--------- src/interface/version.i | 3 --- src/swig-0_27_3/basicio_wrap.cxx | 20 ++++++++++++++++++++ src/swig-0_27_3/exif_wrap.cxx | 6 ++++++ src/swig-0_27_3/image_wrap.cxx | 8 ++++++++ src/swig-0_27_3/preview_wrap.cxx | 4 ++++ src/swig-0_27_3/version_wrap.cxx | 3 --- src/swig-0_27_7/basicio_wrap.cxx | 20 ++++++++++++++++++++ src/swig-0_27_7/exif_wrap.cxx | 6 ++++++ src/swig-0_27_7/image_wrap.cxx | 8 ++++++++ src/swig-0_27_7/preview_wrap.cxx | 4 ++++ src/swig-0_27_7/version_wrap.cxx | 3 --- src/swig-0_28_2/basicio_wrap.cxx | 20 ++++++++++++++++++++ src/swig-0_28_2/exif_wrap.cxx | 6 ++++++ src/swig-0_28_2/image_wrap.cxx | 8 ++++++++ src/swig-0_28_2/preview_wrap.cxx | 4 ++++ src/swig-0_28_2/version_wrap.cxx | 3 --- 18 files changed, 121 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-windows-27.yml b/.github/workflows/build-windows-27.yml index 4f1f541..35f08eb 100644 --- a/.github/workflows/build-windows-27.yml +++ b/.github/workflows/build-windows-27.yml @@ -56,7 +56,7 @@ jobs: cmake -B build-msvc -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=build-msvc/install - -D EXIV2_ENABLE_WIN_UNICODE=ON + -D EXIV2_ENABLE_WIN_UNICODE=OFF -D EXIV2_BUILD_SAMPLES=OFF -D EXIV2_BUILD_EXIV2_COMMAND=OFF -D EXIV2_ENABLE_BMFF=ON diff --git a/src/interface/shared/windows_path.i b/src/interface/shared/windows_path.i index 0c7ad5f..32f2aea 100644 --- a/src/interface/shared/windows_path.i +++ b/src/interface/shared/windows_path.i @@ -18,37 +18,34 @@ %include "shared/windows_cp.i" -// If exiv2's wstring methods are available then use them! -#ifdef EXV_UNICODE_PATH -%include "std_wstring.i" -#endif - // Macro to convert Windows path inputs from utf-8 to current code page %define WINDOWS_PATH(signature) -#ifndef EXV_UNICODE_PATH %typemap(check, fragment="utf8_to_wcp") signature { +%#ifdef _WIN32 if (utf8_to_wcp($1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +%#endif } -#endif %enddef // WINDOWS_PATH // Macro to convert Windows path outputs from current code page to utf-8 %define WINDOWS_PATH_OUT(function) -#ifndef EXV_UNICODE_PATH %typemap(out, fragment="utf8_to_wcp") std::string function { +%#ifdef _WIN32 if (utf8_to_wcp(&$1, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +%#endif $result = SWIG_From_std_string($1); } %typemap(out, fragment="utf8_to_wcp") const std::string& function { std::string copy = *$1; +%#ifdef _WIN32 if (utf8_to_wcp(©, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +%#endif $result = SWIG_From_std_string(copy); } -#endif %enddef // WINDOWS_PATH_OUT diff --git a/src/interface/version.i b/src/interface/version.i index 1311735..2673b71 100644 --- a/src/interface/version.i +++ b/src/interface/version.i @@ -55,9 +55,6 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_VIDEO video = true; #endif -#ifdef EXV_UNICODE_PATH - unicode = true; -#endif #ifdef EXV_ENABLE_WEBREADY webready = true; #endif diff --git a/src/swig-0_27_3/basicio_wrap.cxx b/src/swig-0_27_3/basicio_wrap.cxx index 42f689c..2b76c2f 100644 --- a/src/swig-0_27_3/basicio_wrap.cxx +++ b/src/swig-0_27_3/basicio_wrap.cxx @@ -5735,9 +5735,11 @@ SWIGINTERN PyObject *_wrap_BasicIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::BasicIo * >(argp1); result = ((Exiv2::BasicIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -5767,9 +5769,11 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6536,9 +6540,11 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6702,9 +6708,11 @@ SWIGINTERN PyObject *_wrap_FileIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::FileIo * >(argp1); result = ((Exiv2::FileIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -7483,9 +7491,11 @@ SWIGINTERN PyObject *_wrap_MemIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::MemIo * >(argp1); result = ((Exiv2::MemIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -7519,9 +7529,11 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -7633,9 +7645,11 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8389,9 +8403,11 @@ SWIGINTERN PyObject *_wrap_RemoteIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::RemoteIo * >(argp1); result = ((Exiv2::RemoteIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -8434,9 +8450,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject } arg2 = static_cast< size_t >(val2); { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8477,9 +8495,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_3/exif_wrap.cxx b/src/swig-0_27_3/exif_wrap.cxx index 179d4fb..8ae5d9f 100644 --- a/src/swig-0_27_3/exif_wrap.cxx +++ b/src/swig-0_27_3/exif_wrap.cxx @@ -8633,9 +8633,11 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8841,9 +8843,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py } arg5 = static_cast< uint16_t >(val5); { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8970,9 +8974,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_3/image_wrap.cxx b/src/swig-0_27_3/image_wrap.cxx index 44aa5da..ec82656 100644 --- a/src/swig-0_27_3/image_wrap.cxx +++ b/src/swig-0_27_3/image_wrap.cxx @@ -6245,9 +6245,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6303,9 +6305,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6451,9 +6455,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6568,9 +6574,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_3/preview_wrap.cxx b/src/swig-0_27_3/preview_wrap.cxx index 216a3c1..65f5c35 100644 --- a/src/swig-0_27_3/preview_wrap.cxx +++ b/src/swig-0_27_3/preview_wrap.cxx @@ -6347,9 +6347,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6405,9 +6407,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_extension(PyObject *self, PyObject *args arg1 = reinterpret_cast< Exiv2::PreviewImage * >(argp1); result = ((Exiv2::PreviewImage const *)arg1)->extension(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; diff --git a/src/swig-0_27_3/version_wrap.cxx b/src/swig-0_27_3/version_wrap.cxx index ced3e77..9078c28 100644 --- a/src/swig-0_27_3/version_wrap.cxx +++ b/src/swig-0_27_3/version_wrap.cxx @@ -4272,9 +4272,6 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_VIDEO video = true; #endif -#ifdef EXV_UNICODE_PATH - unicode = true; -#endif #ifdef EXV_ENABLE_WEBREADY webready = true; #endif diff --git a/src/swig-0_27_7/basicio_wrap.cxx b/src/swig-0_27_7/basicio_wrap.cxx index 42f689c..2b76c2f 100644 --- a/src/swig-0_27_7/basicio_wrap.cxx +++ b/src/swig-0_27_7/basicio_wrap.cxx @@ -5735,9 +5735,11 @@ SWIGINTERN PyObject *_wrap_BasicIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::BasicIo * >(argp1); result = ((Exiv2::BasicIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -5767,9 +5769,11 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6536,9 +6540,11 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6702,9 +6708,11 @@ SWIGINTERN PyObject *_wrap_FileIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::FileIo * >(argp1); result = ((Exiv2::FileIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -7483,9 +7491,11 @@ SWIGINTERN PyObject *_wrap_MemIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::MemIo * >(argp1); result = ((Exiv2::MemIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -7519,9 +7529,11 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -7633,9 +7645,11 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8389,9 +8403,11 @@ SWIGINTERN PyObject *_wrap_RemoteIo_path(PyObject *self, PyObject *args) { arg1 = reinterpret_cast< Exiv2::RemoteIo * >(argp1); result = ((Exiv2::RemoteIo const *)arg1)->path(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; @@ -8434,9 +8450,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject } arg2 = static_cast< size_t >(val2); { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8477,9 +8495,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_7/exif_wrap.cxx b/src/swig-0_27_7/exif_wrap.cxx index 179d4fb..8ae5d9f 100644 --- a/src/swig-0_27_7/exif_wrap.cxx +++ b/src/swig-0_27_7/exif_wrap.cxx @@ -8633,9 +8633,11 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8841,9 +8843,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py } arg5 = static_cast< uint16_t >(val5); { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8970,9 +8974,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_7/image_wrap.cxx b/src/swig-0_27_7/image_wrap.cxx index 44aa5da..ec82656 100644 --- a/src/swig-0_27_7/image_wrap.cxx +++ b/src/swig-0_27_7/image_wrap.cxx @@ -6245,9 +6245,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6303,9 +6305,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6451,9 +6455,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6568,9 +6574,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_27_7/preview_wrap.cxx b/src/swig-0_27_7/preview_wrap.cxx index 216a3c1..65f5c35 100644 --- a/src/swig-0_27_7/preview_wrap.cxx +++ b/src/swig-0_27_7/preview_wrap.cxx @@ -6347,9 +6347,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6405,9 +6407,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_extension(PyObject *self, PyObject *args arg1 = reinterpret_cast< Exiv2::PreviewImage * >(argp1); result = ((Exiv2::PreviewImage const *)arg1)->extension(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; diff --git a/src/swig-0_27_7/version_wrap.cxx b/src/swig-0_27_7/version_wrap.cxx index ced3e77..9078c28 100644 --- a/src/swig-0_27_7/version_wrap.cxx +++ b/src/swig-0_27_7/version_wrap.cxx @@ -4272,9 +4272,6 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_VIDEO video = true; #endif -#ifdef EXV_UNICODE_PATH - unicode = true; -#endif #ifdef EXV_ENABLE_WEBREADY webready = true; #endif diff --git a/src/swig-0_28_2/basicio_wrap.cxx b/src/swig-0_28_2/basicio_wrap.cxx index 1f615ac..92e41ce 100644 --- a/src/swig-0_28_2/basicio_wrap.cxx +++ b/src/swig-0_28_2/basicio_wrap.cxx @@ -5941,9 +5941,11 @@ SWIGINTERN PyObject *_wrap_BasicIo_path(PyObject *self, PyObject *args) { result = (std::string *) &((Exiv2::BasicIo const *)arg1)->path(); { std::string copy = *result; +#ifdef _WIN32 if (utf8_to_wcp(©, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(copy); } return resultobj; @@ -5973,9 +5975,11 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6742,9 +6746,11 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6909,9 +6915,11 @@ SWIGINTERN PyObject *_wrap_FileIo_path(PyObject *self, PyObject *args) { result = (std::string *) &((Exiv2::FileIo const *)arg1)->path(); { std::string copy = *result; +#ifdef _WIN32 if (utf8_to_wcp(©, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(copy); } return resultobj; @@ -7691,9 +7699,11 @@ SWIGINTERN PyObject *_wrap_MemIo_path(PyObject *self, PyObject *args) { result = (std::string *) &((Exiv2::MemIo const *)arg1)->path(); { std::string copy = *result; +#ifdef _WIN32 if (utf8_to_wcp(©, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(copy); } return resultobj; @@ -7727,9 +7737,11 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -7841,9 +7853,11 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8620,9 +8634,11 @@ SWIGINTERN PyObject *_wrap_RemoteIo_path(PyObject *self, PyObject *args) { result = (std::string *) &((Exiv2::RemoteIo const *)arg1)->path(); { std::string copy = *result; +#ifdef _WIN32 if (utf8_to_wcp(©, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(copy); } return resultobj; @@ -8665,9 +8681,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject } arg2 = static_cast< size_t >(val2); { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -8708,9 +8726,11 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_28_2/exif_wrap.cxx b/src/swig-0_28_2/exif_wrap.cxx index 6b5b1e3..7474a21 100644 --- a/src/swig-0_28_2/exif_wrap.cxx +++ b/src/swig-0_28_2/exif_wrap.cxx @@ -8837,9 +8837,11 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -9045,9 +9047,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py } arg5 = static_cast< uint16_t >(val5); { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -9174,9 +9178,11 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_28_2/image_wrap.cxx b/src/swig-0_28_2/image_wrap.cxx index 8b257bc..9689dc3 100644 --- a/src/swig-0_28_2/image_wrap.cxx +++ b/src/swig-0_28_2/image_wrap.cxx @@ -6312,9 +6312,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6370,9 +6372,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t arg2 = static_cast< bool >(val2); } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6518,9 +6522,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6635,9 +6641,11 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize arg1 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg1, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { diff --git a/src/swig-0_28_2/preview_wrap.cxx b/src/swig-0_28_2/preview_wrap.cxx index e0a82e9..2dc743f 100644 --- a/src/swig-0_28_2/preview_wrap.cxx +++ b/src/swig-0_28_2/preview_wrap.cxx @@ -6347,9 +6347,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args arg2 = ptr; } { +#ifdef _WIN32 if (utf8_to_wcp(arg2, true) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode path"); } +#endif } { try { @@ -6405,9 +6407,11 @@ SWIGINTERN PyObject *_wrap_PreviewImage_extension(PyObject *self, PyObject *args arg1 = reinterpret_cast< Exiv2::PreviewImage * >(argp1); result = ((Exiv2::PreviewImage const *)arg1)->extension(); { +#ifdef _WIN32 if (utf8_to_wcp(&result, false) < 0) { SWIG_exception_fail(SWIG_ValueError, "failed to transcode result"); } +#endif resultobj = SWIG_From_std_string(result); } return resultobj; diff --git a/src/swig-0_28_2/version_wrap.cxx b/src/swig-0_28_2/version_wrap.cxx index 4fbe615..65699f5 100644 --- a/src/swig-0_28_2/version_wrap.cxx +++ b/src/swig-0_28_2/version_wrap.cxx @@ -4272,9 +4272,6 @@ static PyObject* versionInfo() { #ifdef EXV_ENABLE_VIDEO video = true; #endif -#ifdef EXV_UNICODE_PATH - unicode = true; -#endif #ifdef EXV_ENABLE_WEBREADY webready = true; #endif