residualvm/residualvm — pull request #1093 by bgK (2014-09-09 14:31:41+00:00)
Title: COMMON: Add a function for converting strings using iconv

The subtitles for the Japanese version of Myst III are encoded as Shift JIS / CP932. In order to render them using a TrueType font, it is required to convert them to Unicode.

This pull request adds a common function allowing to convert strings from a specified charset to unicode strings (Common::U32String) using the library iconv.

The iconv library is quite a common dependency. SDL optionally depends upon it. I don't think it is an issue to do the same.

The mapping from CP932 to unicode is [non-trivial](http://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT), which is why iconv was used, and not some kind of table based transcoding.

These patches were done by @clone2727 (https://github.com/clone2727/scummvm/commits/iconv), all the credit goes to him. They were required for some other project he is working on. The very same changes are intended to be added to ScummVM as well at some point. Thus, I kept the ScummVM headers for the new files, to ease future sync.

About Myst III, Japanese subtitles support using this function has been added by commit https://github.com/residualvm/residualvm/commit/555afa813667d17a71d3beb3832ca49a9ac348aa. If the library is missing, the Japanese subtitles will not be displayed, and the user will be shown a warning. Unfortunately, that makes the game incompletable without prior knowledge, since the subtitles are required to solve a puzzle.

![catherine-jpn](https://cloud.githubusercontent.com/assets/52294/4202977/631d085a-382c-11e4-8ab3-55cc8199bb6b.png)