Bing / Microsoft Translator in C/C++ - example included RRS feed

  • Question

  • I created a C++ project that needs automated language translation services. None of the MS documentation has a C++ example (only C# and PHP).  Plus none were to be found on the web anywhere (at least nothing current with the latest authentication setup), so I made my own.

    The first attempt uses the WinINet API with only the single key Microsoft.Translator.Translate method so far, but it would be easy enough to add more to it.

    Example of it's simple interface:

    Example 1

    Normal output:

    Sample output 1

    Any special German characters would probably show up as garbage. It's possible with a few machinations to show such text (UTF-8) in a console, but this is only demonstration example for development.

    Code and more here: (Blog) Bing / Microsoft Translator C++ example

    Thursday, October 18, 2012 5:01 AM

All replies

  • This is really useful! Nice job!
    Monday, October 22, 2012 4:12 PM
  • Hi! I found your program very useful.

    But there is a problem when it deals with Chinese.

    The result looks like unreadable and sometimes it can't connect to the server.

    The weirdest thing is that it works very well with nl and de.

    Saturday, December 22, 2012 5:24 AM
  • Thanks a lot, Victor, for posting your example.

    Iris, you will not see the Chinese characters in a console window unless your OS System Locale is Chinese. Best to write the output to a file and then view it with Unicode encoding.

    Let us know if this helps,
    Chris Wendt
    Microsoft Translator

    Sunday, December 23, 2012 10:01 PM