summaryrefslogtreecommitdiff
path: root/src/charset/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'src/charset/codecs')
-rw-r--r--src/charset/codecs/codec_8859.c4
-rw-r--r--src/charset/codecs/codec_ext8.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/charset/codecs/codec_8859.c b/src/charset/codecs/codec_8859.c
index ef63d4f..5384729 100644
--- a/src/charset/codecs/codec_8859.c
+++ b/src/charset/codecs/codec_8859.c
@@ -563,10 +563,10 @@ parserutils_error charset_8859_to_ucs4(charset_8859_codec *c,
if (*s < 0x80) {
out = *s;
} else if (*s >= 0xA0) {
- if (c->table[*s] == 0xFFFF)
+ if (c->table[*s - 0xA0] == 0xFFFF)
return PARSERUTILS_INVALID;
- out = c->table[*s];
+ out = c->table[*s - 0xA0];
} else {
return PARSERUTILS_INVALID;
}
diff --git a/src/charset/codecs/codec_ext8.c b/src/charset/codecs/codec_ext8.c
index d85f87b..5d21024 100644
--- a/src/charset/codecs/codec_ext8.c
+++ b/src/charset/codecs/codec_ext8.c
@@ -557,10 +557,10 @@ parserutils_error charset_ext8_to_ucs4(charset_ext8_codec *c,
if (*s < 0x80) {
out = *s;
} else {
- if (c->table[*s] == 0xFFFF)
+ if (c->table[*s - 0x80] == 0xFFFF)
return PARSERUTILS_INVALID;
- out = c->table[*s];
+ out = c->table[*s - 0x80];
}
*ucs4 = out;