diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-10 14:29:27 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-10 14:29:27 +0100 |
commit | 89f5244007965c047ddf7943daf285cb3832b733 (patch) | |
tree | f7f2192afa8bd244637dea2311288ba531d1b76e /libsi | |
parent | d34abd6665242550e8aed1c134de7fd83e86bb5b (diff) | |
download | vdr-89f5244007965c047ddf7943daf285cb3832b733.tar.gz vdr-89f5244007965c047ddf7943daf285cb3832b733.tar.bz2 |
Added command line option --chartab to replace VDR_CHARSET_OVERRIDE
Diffstat (limited to 'libsi')
-rw-r--r-- | libsi/si.c | 15 | ||||
-rw-r--r-- | libsi/si.h | 5 |
2 files changed, 15 insertions, 5 deletions
@@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.c 3.2 2015/02/01 14:55:27 kls Exp $ + * $Id: si.c 3.3 2015/02/10 13:42:41 kls Exp $ * * ***************************************************************************/ @@ -319,6 +319,14 @@ bool systemCharacterTableIsSingleByte(void) return SystemCharacterTableIsSingleByte; } +static char *OverrideCharacterTable = NULL; + +void SetOverrideCharacterTable(const char *CharacterTable) +{ + free(OverrideCharacterTable); + OverrideCharacterTable = CharacterTable ? strdup(CharacterTable) : NULL; +} + bool SetSystemCharacterTable(const char *CharacterTable) { if (CharacterTable) { for (unsigned int i = 0; i < NumEntries(CharacterTables1); i++) { @@ -348,9 +356,8 @@ const char *getCharacterTable(const unsigned char *&buffer, int &length, bool *i // Workaround for broadcaster stupidity: according to // "ETSI EN 300 468" the default character set is ISO6937. But unfortunately some // broadcasters actually use ISO-8859-9, but fail to correctly announce that. - static const char *CharsetOverride = getenv("VDR_CHARSET_OVERRIDE"); - if (CharsetOverride) - cs = CharsetOverride; + if (OverrideCharacterTable) + cs = OverrideCharacterTable; if (isSingleByte) *isSingleByte = false; if (length <= 0) @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.h 3.3 2015/02/01 14:55:27 kls Exp $ + * $Id: si.h 3.4 2015/02/10 13:54:28 kls Exp $ * * ***************************************************************************/ @@ -522,6 +522,9 @@ protected: void decodeText(char *buffer, char *shortVersion, int sizeBuffer, int sizeShortVersion); }; +// Set the character table to use for strings that do not begin with a character +// table indicator. Call with NULL to turn this off. +void SetOverrideCharacterTable(const char *CharacterTable); // Call this function to set the system character table. CharacterTable is a string // like "iso8859-15" or "utf-8" (case insensitive). // Returns true if the character table was recognized. |