jmcnamara / libxlsxwriter

A C library for creating Excel XLSX files.
https://libxlsxwriter.github.io
Other
1.48k stars 330 forks source link

Issue: Corrupt file compiled using VS2008 on Windows #434

Closed myspace9 closed 5 months ago

myspace9 commented 5 months ago

After libxlaxwriter successfully compiled using VS2008 on the Windows platform, the xlsx file created was opened as a corrupted file. After decompressing the xlsx file and checking the components, it was found that there were errors in the XML content, such as garbled, binary, or missing content

myspace9 commented 5 months ago

QQ截图20240311144815

myspace9 commented 5 months ago

this is ".rels "

jmcnamara commented 5 months ago

It looks like the file may contain text that isn't UTF-8 which is the only encoding supported by Excel. Could that be the case? What text encoding are you using?

myspace9 commented 5 months ago

It looks like the file may contain text that isn't UTF-8 which is the only encoding supported by Excel. Could that be the case? What text encoding are you using?

only i delete emyg_dtoa.c

myspace9 commented 5 months ago

It looks like the file may contain text that isn't UTF-8 which is the only encoding supported by Excel. Could that be the case? What text encoding are you using?

only i delete emyg_dtoa.c

The problem has been resolved

myspace9 commented 5 months ago

but,the cell value can not support Chinese,do you have any good suggestions? Thank you

jmcnamara commented 5 months ago

Just to be clear, is the issue resolve and what resolves it?

myspace9 commented 5 months ago

Just to be clear, is the issue resolve and what resolves it?

resolving the encoding by adding emyg_dtoa.c and for Chinese, setting the conversion from GBK to UTF8

jmcnamara commented 5 months ago

resolving the encoding by adding emyg_dtoa.c

That is interesting. Do you know why that fixed it?

The usual reason is that files are corrupted and then fixed by emyg_dtoa.c is that floats in the users locale are written with a comma as a decimal point like this: 1234,56. That happens in German locales. Could that be the case in your locale?