summaryrefslogtreecommitdiff
path: root/src/htscharset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/htscharset.c')
-rw-r--r--src/htscharset.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/htscharset.c b/src/htscharset.c
index 1e46562..9f9ee55 100644
--- a/src/htscharset.c
+++ b/src/htscharset.c
@@ -554,6 +554,7 @@ size_t hts_copyStringUTF8(char *dest, const char *src, size_t size) {
for(i = 0, mark = 0; ( i == 0 || bytes[i + 1] != '\0' ) && i <= size; i++) {
const unsigned char c = bytes[i];
+ dest[i] = c;
if (HTS_IS_LEADING_UTF8(c)) {
mark = i;
}
@@ -563,6 +564,11 @@ size_t hts_copyStringUTF8(char *dest, const char *src, size_t size) {
return mark;
}
+size_t hts_appendStringUTF8(char *dest, const char *src, size_t nBytes) {
+ const size_t size = strlen(dest);
+ return hts_copyStringUTF8(dest + size, src, nBytes);
+}
+
int hts_isCharsetUTF8(const char *charset) {
return charset != NULL
&& ( strcasecmp(charset, "utf-8") == 0