Revert "PR-108 - fix possible problems with some Polish channels char encoding."

Fixes #1240

This reverts commit e14391323f.
This commit is contained in:
Adam Sutton 2012-09-21 22:08:48 +01:00
parent 4f5a4da2a7
commit 81be9a275d

View file

@ -41,11 +41,6 @@ static int convert_iso_8859[16] = {
#define convert_utf8 14
#define convert_iso6937 15
#define PL_FIX_CHARS \
"\xA1\xA3\xA6\xAC\xAF\xB1\xB3\xB6\xBC\xBF"\
"\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xCA\xCB\xCD\xCE\xCF"\
"\xD1\xD3\xE6\xE8\xEA\xF1\xF3\xF8"
static inline int encode_utf8(unsigned int c, char *outb, int outleft)
{
if (c <= 0x7F && outleft >= 1) {
@ -230,11 +225,7 @@ dvb_get_string(char *dst, size_t dstlen, const uint8_t *src, size_t srclen, char
return -1;
case 0x01 ... 0x0b:
// NOTE: some Polish channels using ISO6937 while specifying ISO8859-4
if ((src[0] + 4) == 5 && strpbrk((const char*)src, PL_FIX_CHARS))
ic = convert_iso6937;
else
ic = convert_iso_8859[src[0] + 4];
ic = convert_iso_8859[src[0] + 4];
src++; srclen--;
break;
@ -266,11 +257,7 @@ dvb_get_string(char *dst, size_t dstlen, const uint8_t *src, size_t srclen, char
ic = convert_iso6937;
}
} else {
// Note: some Polish channels using ISO8859-2 while specifying no encoding
if (strpbrk((const char*)src, PL_FIX_CHARS))
ic = convert_iso_8859[2];
else
ic = convert_iso6937;
ic = convert_iso6937;
}
break;
}