Port lowercase char problem to C++.