aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-12-27 23:55:23 +0000
committerGuy Harris <guy@alum.mit.edu>2013-12-27 23:55:23 +0000
commita8ac1188855bff2d4ab39dab5a582e921054464d (patch)
tree43f3562ede6d3d5810e08904ca483305c0af11cd
parentd6b35d5c6b46772b8fdf3f7e049bd5690b12c324 (diff)
Use Unicode REPLACEMENT CHARACTER for TS 23.038 errors, as we do for
unassigned code points in some other character sets. svn path=/trunk/; revision=54477
-rw-r--r--epan/tvbuff.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 0f88d491f1..d6f932d4b5 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -1845,6 +1845,9 @@ tvb_format_stringzpad_wsp(tvbuff_t *tvb, const gint offset, const gint size)
return format_text_wsp(ptr, stringlen);
}
+/* Unicode REPLACEMENT CHARACTER */
+#define UNREPL 0x00FFFD
+
/*
* Given a tvbuff, an offset, and a length, allocate a buffer big enough
* to hold a non-null-terminated string of that length at that offset,
@@ -2202,7 +2205,7 @@ char_def_alphabet_ext_decode(unsigned char value)
case 0x3e: return ']';
case 0x40: return '|';
case 0x65: return 0x20ac; /* euro */
- default: return '?'; /* invalid character XXX use REPLACEMENT CHARACTER */
+ default: return UNREPL; /* invalid character */
}
}
@@ -2215,7 +2218,7 @@ char_def_alphabet_decode(unsigned char value)
}
else
{
- return '?';
+ return UNREPL;
}
}
@@ -2304,9 +2307,10 @@ tvb_get_ts_23_038_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offs
/*
* Escape not followed by anything.
*
- * XXX - for now, show the escape as a "?".
+ * XXX - for now, show the escape as a REPLACEMENT
+ * CHARACTER.
*/
- wmem_strbuf_append_unichar(strbuf, '?');
+ wmem_strbuf_append_unichar(strbuf, UNREPL);
}
return (gchar*)wmem_strbuf_get_str(strbuf);