[gnumeric] xls: when writing strings that cannot be represented, substitute a ?



commit 78cfbb95ab9afed032a9f902853ac84e94ca777e
Author: Morten Welinder <terra gnome org>
Date:   Sat Feb 22 14:57:40 2014 -0500

    xls: when writing strings that cannot be represented, substitute a ?

 plugins/excel/ChangeLog        |    1 +
 plugins/excel/ms-excel-write.c |    6 +-----
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 9d65fcd..6e2f843 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -3,6 +3,7 @@
        * ms-excel-write.c (excel_convert_string): New function.
        (excel_write_comments_biff7): Avoid infinite loop when a comment
        contains characters that cannot be represented in the codepage.
+       (excel_write_string): Use excel_convert_string.
 
 2014-02-21  Morten Welinder  <terra gnome org>
 
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 137e1b4..7780e4e 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -389,11 +389,7 @@ excel_write_string (BiffPut *bp, WriteStringFlags flags,
 
        char_len = excel_strlen (txt, &byte_len);
        if (char_len != byte_len || (flags & STR_SUPPRESS_HEADER)) {
-               convdata = (gpointer)g_convert_with_iconv
-                       (txt, -1,
-                        bp->convert,
-                        NULL, &conv_bytes,
-                        NULL);
+               convdata = excel_convert_string (bp, txt, &conv_bytes);
                isunistr = 1;
 
                /* g_convert_with_iconv terminates with 4 NULs.  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]