Changed the buffer size, added the setlocale.