Allowed char set

It includes commits from fixing last pull request, so merge this one last. I did not want to merge it later.