use the same code path for varchar counting