mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #230] workbook_validate_sheet_name gives wrong answer, should be case-insensitive #185
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#185
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 @mewalig on GitHub (Jun 5, 2019).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/230
Originally assigned to: @jmcnamara on GitHub.
For example, if a workbook has a worksheet "abcde", workbook_validate_sheet_name("ABCDE") should return LXW_ERROR_SHEETNAME_ALREADY_USED, but does not.
I believe this issue exists because _worksheet_name_cmp() is not case-insensitive, but should be. _chartsheet_name_cmp() might have the same issue.
I understand this issue can be more complicated with multibyte chars. A full solution might use something like ICU or iconv for case-insensitive compare. However, a partial solution, which is easy and at least reduces the size of the problem, could be to do char-by-char compare that is case-insensitive for a-zA-Z and is otherwise strict.
Below is a possible partial solution (only for A-Z) that doesn't require using a library for multibyte case-insensitive compare:
@jmcnamara commented on GitHub (Jun 5, 2019):
Thanks. That is a bug.
This is checked for in the Perl and Python versions, where the check is easier.
@jmcnamara commented on GitHub (Jun 7, 2019):
I've push a fix for this to master, along the lines of your suggestion.
From the updated docs: