[gnumeric-list][PATCH to gnumeric] handle unicode and codepages for Import/Export of Excel files


 Here is a patch against gnumeric-0.63 that adds support for full handling of
unicode and codepages for Import/Export of Excel files. Textual data from
Excel files will be converted to the current locale's encoding when importing
.xls files and will be converted from current locale's encoding to the
codepage corresponding to the language of the current locale when exporting to
.xls files.

 Additional functions from libc required for functioning: wcstombs and
mbstowcs (required by SVID 3), and also optionally iconv{,open,close} - by
undefining preprocessor symbol the code will compile and work without the
iconv* functions too (though actual conversion won't happen).

 It should work correctly for any encoding, including mutlibyte ones (not
tested). This patch was tested with russian, import of Excel 97 and Excel 95
files and export to Excel works flawless.

 Before this patch, import and export was working correctly only for
single-byte encodings, and was giving correct results only for latin1
locales. E.g. for russian all russian strings were becoming
unreadable in gnumeric after importing  .xls of any version and in MS
Excel after export of .xls files from gnumeric (i.e works fine without any
flaws for russian, and should work for any non-latin1 locale too, I hope).

 It seems this patch will help even people using latin languages due to
differences between CP1252 (used for latin1 in Windows) and ISO-8859-1 (used
for latin1 on Unix). And it seems this patch will allow gnumeric to
import/export latin1 chars under UTF8 locales too without problems (so that
characters with value > 127 will be imported/exported correctly).

 It would be nice if this patch was included in Gnumeric that will be shipped
with gnome-1.4.

 What do you think about it?

 Best regards,

Attachment: gnumeric-excelIO-i18n-patch
Description: Text document

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