Implement and test PathIsValidChar{A,W}.