-
Notifications
You must be signed in to change notification settings - Fork 695
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
Low-order non-printable ASCII characters in worksheet name should be escaped or removed #654
Comments
Does it make sense to retain such (escaped) characters in sheet names? In cells for example they are removed, see Cell#clean_value which calls Axlsx.sanitize which removes control characters. |
@noniq I'm not sure which is better, removing or escaping non-printable ASCII characters in sheet names. If it is undocumented or is undefined behavior, it's best to be removed. if it is a valid name, it make sense to retain it. |
My gut feeling is that non-printable characters should not be allowed to be part of a sheet name. Are there any references to what constitutes a valid sheet name in the Excel docs? |
I didn't find any references about what to do with non-printable characters 🤔. |
Would you like to prepare a pull request? axlsx is currently unmaintained though, so please create the pull request in the https://github.com/caxlsx/caxlsx repository (that's the actively maintained community fork). |
The worksheet name was escaped as HTML since #112.
But It seems to be not working with some special characters, "\b" character for example.
I think it should be escaped as XML.
See: https://support.microsoft.com/en-us/help/315580/prb-error-message-when-an-xml-document-contains-low-order-ascii-charac
Steps to reproduce
aslsx
.simple1.xlsx
to open it.It will say that the excel is corrupted.
Possible fixes
We can use
Builder::XChar.encode
to escape the worksheet name.The produced excel file
simple2.xlsx
works fine.The text was updated successfully, but these errors were encountered: