summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Mathog <>2012-12-04 09:47:30 +0000
committer~suv <suv-sf@users.sourceforge.net>2012-12-04 09:47:30 +0000
commitf46ce8604fb57e90ec9c43cd6f946e4c44c7eb4b (patch)
tree9bcca5378b63f6b2884df38b06a14caac2e7d747 /src
parentmerge from trunk (r11903) (diff)
downloadinkscape-f46ce8604fb57e90ec9c43cd6f946e4c44c7eb4b.tar.gz
inkscape-f46ce8604fb57e90ec9c43cd6f946e4c44c7eb4b.zip
changes_2012-11_28.patch
EMF import: - fix a bug which could potentially show up when a UTF16 string was read from an EMF file that contained mostly glyphs that needed 3 or 4 byte UTF-8 encoding. (bzr r11668.1.43)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/uemf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/extension/internal/uemf.c b/src/extension/internal/uemf.c
index 50ba9933b..785bb475e 100644
--- a/src/extension/internal/uemf.c
+++ b/src/extension/internal/uemf.c
@@ -14,8 +14,8 @@
/*
File: uemf.c
-Version: 0.0.9
-Date: 26-OCT-2012
+Version: 0.0.10
+Date: 28-NOV-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
@@ -477,7 +477,8 @@ char *U_Utf16leToUtf8(
size_t srclen,dstlen,status;
if(max){ srclen = 2*max; }
else { srclen = 2*(1 +wchar16len(src)); } //include terminator, length in BYTES
- dstlen = 1 + srclen; // this will always work, but may waste space
+ dstlen = 1 + 2*srclen; // this will always work, but may waste space
+ // worst case is all glyphs (==max) need 4 UTF-8 encoded bytes + terminator.
dst2 = dst = (char *) calloc(dstlen,1);
if(!dst)return(NULL);
iconv_t conv = iconv_open("UTF-8", "UTF-16LE");