Hey,
Today was my first time using the library. While trying it out, I happened to start with the Base32 API using a simple call like this:
string encoded = Base32.Rfc4648.Encode(data);
On my machine, this immediately threw an IndexOutOfRangeException.
Then I started investigating and downgraded the package version by version and found that v5.3.0 works correctly, while newer versions do not.
Since the project's CI pipeline runs on Ubuntu, I tried reproducing the issue there. The same code worked without any problems, and the build logs confirmed that the test suite also passes successfully on Ubuntu.
Since my Windows installation uses the Turkish (tr-TR) culture, I suspected the issue might be culture-related rather than operating system-specific. To verify this, I ran the same program on Ubuntu with:
LC_ALL=tr_TR.UTF-8 dotnet test
This reproduced the exact same exception.
After debugging the source, I found the root cause. Several ToLower/ToUpper calls are culture-sensitive. Under the Turkish locale, they trigger the well-known "the Turkish I problem", which eventually leads to an IndexOutOfRangeException.
The problem is also reflected in the test suite. With the Turkish locale, the following tests fail:
SimpleBaseTest.Base32Test
SimpleBaseTest.Base36Test
SimpleBaseTest.MultibaseTest
I'll submit a pull request replacing the culture-sensitive case conversions with culture-invariant equivalents.
Hey,
Today was my first time using the library. While trying it out, I happened to start with the Base32 API using a simple call like this:
On my machine, this immediately threw an
IndexOutOfRangeException.Then I started investigating and downgraded the package version by version and found that
v5.3.0works correctly, while newer versions do not.Since the project's CI pipeline runs on Ubuntu, I tried reproducing the issue there. The same code worked without any problems, and the build logs confirmed that the test suite also passes successfully on Ubuntu.
Since my Windows installation uses the Turkish (tr-TR) culture, I suspected the issue might be culture-related rather than operating system-specific. To verify this, I ran the same program on Ubuntu with:
LC_ALL=tr_TR.UTF-8 dotnet testThis reproduced the exact same exception.
After debugging the source, I found the root cause. Several
ToLower/ToUppercalls are culture-sensitive. Under the Turkish locale, they trigger the well-known "the Turkish I problem", which eventually leads to anIndexOutOfRangeException.The problem is also reflected in the test suite. With the Turkish locale, the following tests fail:
SimpleBaseTest.Base32TestSimpleBaseTest.Base36TestSimpleBaseTest.MultibaseTestI'll submit a pull request replacing the culture-sensitive case conversions with culture-invariant equivalents.