-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ColumnIndex negative if culture is tr-TR #470
Comments
This is weird. Can you check if you can reproduce the issue with 2.4.1? Looks to be a issue caused by ThreadLocal variable. Is it possible that something returns null and then FirstCellNum returns -1? |
It doesn't occur in 2.4.1 but does in 2.5.0.
What do you mean exactly? |
@mganss I followed your code. But I still cannot reproduce the issue with NPOI 2.5.2 release. Did I miss something? |
The |
@mganss Thank you for the tip. I can reproduce the issue now. |
I found the root cause but it's very weird behavior of regular expression match. The issue occurs in CellReference.SeparateRefParts method while handling a CT_Cell with r="I1" (Cell Address).
When CultureInfo is tr-TR, CELL_REF_PATTERN.Match partially works. Although Match.Success==true, the group values are still empty string instead of 'I' and '1'. |
The first answer explains the issue. To fix this issue, RegexOptions.CultureInvariant shoud pass to the Regex constructor. |
fix cell reference match issue when CultureInfo is tr-TR #470
I encountered this when investigating mganss/ExcelMapper#87 (see there for demo file). Demo code:
If you change the culture to en-US the issue does not occur. This might be because of the Turkish-I Problem.
The text was updated successfully, but these errors were encountered: