summaryrefslogtreecommitdiff
path: root/libsi/si.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsi/si.c')
-rw-r--r--libsi/si.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libsi/si.c b/libsi/si.c
index 3d5169f6..e51770ab 100644
--- a/libsi/si.c
+++ b/libsi/si.c
@@ -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)