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

为什么sheet不支持区分大小写?( Why does sheet not support case sensitivity?) #1856

Closed
15083787153 opened this issue Mar 20, 2024 · 3 comments · Fixed by #1860
Closed
Labels
bug Something isn't working
Projects

Comments

@15083787153
Copy link

15083787153 commented Mar 20, 2024

目前看库内部使用的strings.EqualFold来比较两个sheet的名字,但是这个函数是不支持区分大小写的。

比如我想将默认的Sheet1改成sheet1,无法直接更改,只能改成另外一个名字,再将这个名字改为sheet1

Currently, the library uses strings.EqualFold internally to compare the names of two sheets, but this function does not support case sensitivity.

For example, I want to change the default Sheet1 to sheet1. I cannot change it directly. I can only change it to another name, and then change the name to sheet1.

@15083787153 15083787153 changed the title 为什么sheet不支持区分大小写? 为什么sheet不支持区分大小写?( Why does sheet not support case sensitivity?) Mar 20, 2024
@xuri xuri added the bug Something isn't working label Mar 20, 2024
@xuri xuri added this to Bugfix in v2.9.0 Mar 20, 2024
@xuri xuri linked a pull request Mar 22, 2024 that will close this issue
10 tasks
xuri pushed a commit that referenced this issue Mar 22, 2024
…und issue (#1860)

- The SetSheetName function now support case sensitivity
- Update unit tests
@xuri
Copy link
Member

xuri commented Mar 22, 2024

Thanks for your issue. This issue has been fixed, please upgrade to the master branch by go get -u github.com/xuri/excelize/v2@master, and this patch will be released in the next version.

@15083787153
Copy link
Author

15083787153 commented Mar 22, 2024

Thanks for your issue. This issue has been fixed, please upgrade to the master branch by go get -u github.com/xuri/excelize/v2@master, and this patch will be released in the next version.

感谢的你的快速回应,如果这是一个bug的话,影响的地方不仅仅是SetSheetName这个函数,还有DeleteSheet这个函数,内部使用的是GetSheetIndex,也许还有更多地方 = =
Thank you for your quick response. If this is a bug, it affects not only the SetSheetName function, but also the DeleteSheet function, which uses GetSheetIndex internally. Maybe there are more = =

@xuri
Copy link
Member

xuri commented Mar 22, 2024

Thanks for your feedback. The sheet name is not case-sensitive by default, you can't create two sheet names "Sheet1" and "sheet1" on a workbook, so I think just need to change the behavior of the SetSheetName function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
v2.9.0
Bugfix
Development

Successfully merging a pull request may close this issue.

2 participants