Implementing some of the locale/codecvt stuff