updated for better unicode settings, etc