summaryrefslogtreecommitdiff
path: root/src/htscoremain.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-05-06 14:31:09 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-05-06 14:31:09 +0000
commit53ee6f78b2f0d2ac7181372f193e4ce666814611 (patch)
tree135c2e29384616ad96529f5ab97f9faa1c6638e0 /src/htscoremain.c
parent8da9b1b413f1bce7e55e7520efa184443493288b (diff)
Test #3
Diffstat (limited to 'src/htscoremain.c')
-rw-r--r--src/htscoremain.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/htscoremain.c b/src/htscoremain.c
index 3654c7d..184a4d0 100644
--- a/src/htscoremain.c
+++ b/src/htscoremain.c
@@ -1713,6 +1713,21 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp *opt) {
return 0;
}
break;
+ case '3': // charset tests: httrack #3 "iso-8859-1" "café"
+ if (argc == 3) {
+ char *s = hts_convertStringToUTF8(argv[2], strlen(argv[2]), argv[1]);
+ if (s != NULL) {
+ printf("%s\n", s);
+ free(s);
+ } else {
+ fprintf(stderr, "invalid string for charset %s\n", argv[1]);
+ }
+ } else {
+ HTS_PANIC_PRINTF("Option #3 needs to be followed by a charset and a string");
+ }
+ htsmain_free();
+ return 0;
+ break;
case '!':
if (na+1>=argc) {
HTS_PANIC_PRINTF("Option #! needs to be followed by a commandline");