comparison enc-text/ucs2.c @ 8:265b8103530c

sms-encode-text: emit empty messages as ""
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 05 Aug 2023 06:40:50 +0000
parents a16b1b9728f6
children e56bb9f09ff1
comparison
equal deleted inserted replaced
7:cd2d82ec5144 8:265b8103530c
35 if (msgtext_unilen <= 70) { 35 if (msgtext_unilen <= 70) {
36 fputs("dcs 8 octet\nmsg ", stdout); 36 fputs("dcs 8 octet\nmsg ", stdout);
37 if (msgtext_unilen) { 37 if (msgtext_unilen) {
38 ucs2_out_bigend(msgtext_uni, ucs2_be, msgtext_unilen); 38 ucs2_out_bigend(msgtext_uni, ucs2_be, msgtext_unilen);
39 emit_hex_out(ucs2_be, msgtext_unilen * 2, stdout); 39 emit_hex_out(ucs2_be, msgtext_unilen * 2, stdout);
40 } else 40 } else {
41 fputs("empty", stdout); 41 putchar('"');
42 putchar('"');
43 }
42 putchar('\n'); 44 putchar('\n');
43 exit(0); 45 exit(0);
44 } 46 }
45 if (!concat_enable) { 47 if (!concat_enable) {
46 fprintf(stderr, "error: message exceeds 70 UCS-2 chars\n"); 48 fprintf(stderr, "error: message exceeds 70 UCS-2 chars\n");