mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #84] Issue with sheet names containing multi-byte (UTF-8) characters #71
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @evanmiller on GitHub (Dec 22, 2016).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/84
Originally assigned to: @jmcnamara on GitHub.
Sheet names longer than 32 bytes are disallowed by libxlsxwriter; however I believe the correct behavior is to disallow sheet names longer than 32 characters.
I am trying to debug a customer issue, and I believe the problem is that sanitized strings which are longer than 32 bytes but shorter than 32 characters are passing my program's internal checks, but then failing to be written out to the spreadsheet.
I'd suggest one of:
strlenworkbook_add_worksheet@jmcnamara commented on GitHub (Dec 22, 2016):
This is a bug that I had in the back of my mind and was on my TODO list to fix.
You are correct that the check should be on characters rather than bytes (like in the Perl and Python versions) and it was my intention to add a UTF-8 strlen. That same applies for most other length checks on user supplied data.
The worksheet name check also needs to disallow certain characters in the name:
[]:*?/\\.And finally there should be suitable warning around this check as well.
Will fix.
@jmcnamara commented on GitHub (Dec 23, 2016):
I've pushed an initial pass at this to the utf8_strlen branch, see commit above, if you'd care to try it out.
You will still have to handle the NULL error condition in your own code.
@evanmiller commented on GitHub (Dec 23, 2016):
Thanks @jmcnamara. Haven't tested but the patch looks fine to me; I'm looking forward to seeing it integrated.
I'll add NULL handling on my end so that is no problem. It might be useful to have a way to validate worksheet names without actually adding them, so that the error condition can be isolated in client code.
lxw_worksheet_name_is_validor something.@evanmiller commented on GitHub (Dec 26, 2016):
Tested
masterwith client code; this bug is now resolved for me. Thanks @jmcnamara!