Why does wprintf fail when my app is localized to non-Latin languages?

If you have a command line application that works just swell with Latin languages, but where wprintf (or any other Unicode stream I/O call) fails to output any localized text after the application has been translated to e.g. Japanese, Russian or Bengali, odds are that you forgot to call setlocale.

Developing International Software, 2nd ed. explains the Unicode I/O functions quite well, and says on page 87:
“[…] if setlocale was not called […] only Latin script is processed and the localized text is not displayed at all.”

This is a good book. You really ought to get it.

Comments (0)