Change locale-independent ctype functions to take an int so they work with wide chars
Reimplement CreatePath properly