summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-23 22:40:10 +0000
committerJabiertxof <jtx@jtx>2017-01-23 22:40:10 +0000
commit8a7004fa550bb1d5eff8ca6ce716b391ea8d9ff8 (patch)
tree598923b2b554aeaf77457a83c399c616a7ecc162 /src/extension
parentRemove unnecesatry text parameter (diff)
parentfix nodes reverting back during editing (diff)
downloadinkscape-8a7004fa550bb1d5eff8ca6ce716b391ea8d9ff8.tar.gz
inkscape-8a7004fa550bb1d5eff8ca6ce716b391ea8d9ff8.zip
Add fixes sugested by Martin Owens
(bzr r15392.1.7)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/cdr-input.cpp7
-rw-r--r--src/extension/internal/vsd-input.cpp7
-rw-r--r--src/extension/internal/wpg-input.cpp7
3 files changed, 21 insertions, 0 deletions
diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp
index 92a11a6ac..0435f1396 100644
--- a/src/extension/internal/cdr-input.cpp
+++ b/src/extension/internal/cdr-input.cpp
@@ -214,6 +214,13 @@ void CdrImportDialog::_setPreviewPage()
SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
{
+ #ifdef WIN32
+ // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
+ // therefore attempt to convert uri to the system codepage
+ // even if this is not possible the alternate short (8.3) file name will be used if available
+ uri = g_win32_locale_filename_from_utf8(uri);
+ #endif
+
RVNGFileStream input(uri);
if (!libcdr::CDRDocument::isSupported(&input)) {
diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp
index 2fb4acf22..78783aa2d 100644
--- a/src/extension/internal/vsd-input.cpp
+++ b/src/extension/internal/vsd-input.cpp
@@ -216,6 +216,13 @@ void VsdImportDialog::_setPreviewPage()
SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
{
+ #ifdef WIN32
+ // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
+ // therefore attempt to convert uri to the system codepage
+ // even if this is not possible the alternate short (8.3) file name will be used if available
+ uri = g_win32_locale_filename_from_utf8(uri);
+ #endif
+
RVNGFileStream input(uri);
if (!libvisio::VisioDocument::isSupported(&input)) {
diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp
index 54a14fc72..12457791b 100644
--- a/src/extension/internal/wpg-input.cpp
+++ b/src/extension/internal/wpg-input.cpp
@@ -81,6 +81,13 @@ namespace Internal {
SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri)
{
+ #ifdef WIN32
+ // RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
+ // therefore attempt to convert uri to the system codepage
+ // even if this is not possible the alternate short (8.3) file name will be used if available
+ uri = g_win32_locale_filename_from_utf8(uri);
+ #endif
+
RVNGInputStream* input = new RVNGFileStream(uri);
#if WITH_LIBWPG03
if (input->isStructured()) {