Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken XLSX because of "vertical tab" ascii character in a cell #234

Closed
apydo opened this issue Nov 30, 2016 · 2 comments
Closed

Broken XLSX because of "vertical tab" ascii character in a cell #234

apydo opened this issue Nov 30, 2016 · 2 comments

Comments

@apydo
Copy link

apydo commented Nov 30, 2016

Excel reports a broken xlsx file if there is an ascii code 0x0B or decimal 11 in a cell. It's also known as VT or "Vertical Tab". Excel consider this character as illegal in xml and the xlsx is broken if it's inside xml found in sharedStrings.xml file.

Is there any function that escapes illegal characters in a string before it's assigned to the cell ?

@NOtherDev
Copy link
Contributor

I have the same problem with the 'start of heading' character (ASCII code 1) that somehow sneaked into the generated content. I believe it should be handled by the library when XML-encoding. I guess the best place would be in xmlEncode function. I'll provide a PR soon.

guyonroche added a commit that referenced this issue Feb 16, 2017
Exclude character controls from XML output. Fixes #234
@apydo
Copy link
Author

apydo commented Feb 17, 2017

Thanks for the fix.

For your information the excluded characters in d072aa7 are not the only ones forbidden in XML.

This wikipedia page specifies what characters are allowed : https://en.wikipedia.org/wiki/Valid_characters_in_XML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants