diff options
author | Jaromir Wysoglad | 2019-08-26 16:48:50 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | 291360a280bef756f2733515a7bd532856572831 (patch) | |
tree | 08b5ecce4e6a5d5dbc356d676a17646781765125 /common/encoding.h | |
parent | 55c399c7c0ebe4084c1bdf31e647cfa50cc01c09 (diff) | |
download | scummvm-rg350-291360a280bef756f2733515a7bd532856572831.tar.gz scummvm-rg350-291360a280bef756f2733515a7bd532856572831.tar.bz2 scummvm-rg350-291360a280bef756f2733515a7bd532856572831.zip |
COMMON: Add CP850 conversion.
CP850 is used by the mortevielle engine (and apparently by other
engines too). Anytime an engine using CP850 encoding wants to use
the TTS, the encoding has to be converted, so this is pretty
important encoding conversion to support. Unfortunately SDL
(when compiled without iconv) doesn't support this encoding
(which means, there might not be a way to convert this encoding
on some platforms), so I added a conversion table for this.
Diffstat (limited to 'common/encoding.h')
-rw-r--r-- | common/encoding.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/encoding.h b/common/encoding.h index 8245157a95..8a77c81b08 100644 --- a/common/encoding.h +++ b/common/encoding.h @@ -173,6 +173,22 @@ class Encoding { static char *convertTransManMapping(const char *to, const char *from, const char *string, size_t length); /** + * Uses conversion table to convert the string to unicode and from that + * to the final encoding. Important encodings, that aren't supported by + * all backends should go here. + * + * The result has to be freed after use. + * + * @param to Name of the encoding the strings will be converted to + * @param from Name of the encoding the strings will be converted from + * @param string String that should be converted. + * @param length Length of the string to convert in bytes. + * + * @return Converted string (must be freed) or nullptr if the conversion failed + */ + static char *convertConversionTable(const char *to, const char *from, const char *string, size_t length); + + /** * Transliterates cyrillic string in iso-8859-5 encoding and returns * it's ASCII (latin) form. * |