summaryrefslogtreecommitdiff
path: root/src/decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/decode.c b/src/decode.c
index b4dd5214..5a1b7bb8 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -15,6 +15,7 @@
#include <stdlib.h> /* strtol */
#include "decode.h"
+#include "utf8.hh"
#include "msg.h"
static const int bufsize = 8*1024;
@@ -164,15 +165,8 @@ static Dstr *Decode_charset(Decode *dc, const char *instr, int inlen)
if (rc == EILSEQ){
inPtr++;
inLeft--;
- /*
- * U+FFFD: "used to replace an incoming character whose value is
- * unknown or unrepresentable in Unicode."
- */
- //dStr_append(output, "\ufffd");
- // \uxxxx is C99. UTF-8-specific:
- dStr_append_c(output, 0xEF);
- dStr_append_c(output, 0xBF);
- dStr_append_c(output, 0xBD);
+ dStr_append_l(output, utf8_replacement_char,
+ sizeof(utf8_replacement_char) - 1);
}
}
dStr_erase(dc->leftover, 0, dc->leftover->len - inLeft);