diff --git a/src/base32.h b/src/base32.h index a93f9180..203bb8b9 100644 --- a/src/base32.h +++ b/src/base32.h @@ -64,6 +64,8 @@ std::string decode(InputIterator first, InputIterator last) unsigned char value; if('A' <= ch && ch <= 'Z') { value = ch-'A'; + } else if('a' <= ch && ch <= 'z') { + value = ch-'a'; } else if('2' <= ch && ch <= '7') { value = ch-'2'+26; } else if(ch == '=') { diff --git a/test/Base32Test.cc b/test/Base32Test.cc index 03d52e8d..aca15b53 100644 --- a/test/Base32Test.cc +++ b/test/Base32Test.cc @@ -48,6 +48,9 @@ void Base32Test::testDecode() s = "GEZDGNBV"; CPPUNIT_ASSERT_EQUAL(std::string("12345"), base32::decode(s.begin(), s.end())); + s = "gezdgnbv"; + CPPUNIT_ASSERT_EQUAL(std::string("12345"), + base32::decode(s.begin(), s.end())); } } // namespace aria2